Web hosting rating - After this command runs, a password to the

After this command runs, a password to the account must be set using the passwd accountname command. To create the password for Jane Doe s account, root would type: passwd unixnewbie The new account owner should change the password immediately. Try It Out Create an Account with useradd A new temporary employee, Sarah Torvalds, has joined your company today (5/01/05). Sarah s manager has requested that you create an account for Sarah. She has joined the company to assist in some end-of-the-year human resources work, so she needs access to the default user group and to the hr group. Her contract with the company ends 120 days from her start day (the same day the account is created). Standard users are created with an inactive account timeout of 30 days, are assigned to the employees group by default, and are assigned the c shell. Usernames are created using the first initial and last name (no more than eight characters total for the account name, in this case for compatibility with other Unix systems). You need to create an account for Sarah using the useradd command because you do not have access to any graphical tools. First log in as root, then run the following commands: # useradd -c Sarah Torvalds -d /home/storvald -e 05/01/05 -f 30 -g employees -G hr -m -s /bin/csh -u 1005 storvald # passwd storvald Changing password for user storvald. New UNIX password: Retype UNIX password: passwd: all authentication tokens updated successfully. # How It Works The useradd command modifies the /etc/passwd, /etc/shadow, and /etc/group files and creates a home directory. Just think how much easier this is than having to manually edit all three files and create the home directory! useradd works quickly because the format for the files is standardized and can be easily used. You can also create scripts using this command to make the process even easier. You can use the -D option to assign default values to some of the useradd values, making the commands easier to run. Refer to the useradd man pages for more information. The usermod command enables you to make changes to an existing account from the command line (instead of modifying system files). It uses the same arguments as the useradd command, plus the -l argument, which allows you to change the account name. For instance, to change Sarah Torvalds account name to saraht and provide her with a home directory, you d issue the following command: usermod -d /home/saraht -m -l saraht storvald This command changes Sarah Torvalds current account (storvald) and makes the new home directory /home/saraht (-d /home/saraht -m) and the new account name saraht (-l saraht). The -m creates the home directory that hadn t previously existed. 42 Chapter 3
Note: If you are looking for best quality webspace to host and run your tomcat application check Vision tomcat hosting services

Leave a Reply