AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Debian buster which package usermod12/26/2023 ![]() Uid=501(tecmint_test) gid=502( babin) groups=502(tecmint_test)Ĭhange User Primary Group 5. Now, set the babin group as a primary group to user tecmint_test and confirm the changes. Uid=501(tecmint_test) gid=502( tecmint_test) groups=502(tecmint_test) Before, changing user primary group, first make sure to check the current group for the user tecmint_test. To set or change a user primary group, we use option ‘ -g‘ with usermod command. The expiry status of a ‘ tecmint‘ user is Dec 1 2014, let’s change it to using ‘ usermod -e‘ option and confirm the expiry date with ‘ chage‘ command. Number of days of warning before password expires : 7 Maximum number of days between password change : 99999 Minimum number of days between password change : 0 Before, setting up an expiry date on a user, let’s first check the current account expiry status using the ‘ chage‘ (change user password expiry information) command. The option ‘ -e‘ is used to set expiry date on a user account with the date format YYYY-MM-DD. Tecmint:x:500:500:This is Tecmint: /var/www:/bin/shĬhange User Home Directory 3. Now, change home directory from /home/tecmint to /var/www/ and confirm the home director after changing. Tecmint:x:500:500:This is Tecmint: /home/tecmint:/bin/sh # grep -E -color '/home/tecmint' /etc/passwd In the above step we can see that our home directory is under /home/tecmint/, If we need to change it to some other directory we can change it using -d option with usermod command.įor example, I want to change our home directory to /var/www/, but before changing, let’s check the current home directory of a user, using the following command. Tecmint:x:500:500: This is Tecmint:/home/tecmint:/bin/shĪdd Information to User 2. # usermod -c " This is Tecmint" tecmintĪfter adding information on user, the same comment can be viewed in /etc/passwd file. For example, let’s add information on ‘ tecmint‘ user, using the following command. The ‘ -c‘ option is used to set a brief comment (information) about the user account. In this article we will see ‘ 15 usermod commands‘ with their practical examples and usage in Linux, which will help you to learn and enhance your command-line skills using these options. This will remove the password lock and allow us to use the user account. -u = Used to Assigned UID for the user account between 0 to 999.-s = Create a Specified shell for new accounts.-p = To Use un-encrypted password for the new password.-m = moving the contents of the home directory from existing home dir to new dir.This will lock the password so we can’t use the account. ![]() -l = To change the login name from tecmint to tecmint_admin.-a = To add anyone of the group to a secondary group.-g = Change the primary group for a User.-e = Using this option we can make the account expiry in specific period.-d = To modify the directory for any existing user account.-c = We can add comment field for the useraccount.Let us see how to use usermod command by modifying some existing users in Linux box with the help of following options. The ‘ usermod‘ command is simple to use with lots of options to make changes to an existing user. Must have basic knowledge of usermod command with options.The usermod command can be executed on any Linux distribution.Only superuser (root) is allowed to execute usermod command.We must have existing user accounts to execute usermod command. ![]()
0 Comments
Read More
Leave a Reply. |