You need to user the useradd command under UNIX operating systems to create user account and password command to set a password for the same. You need to login as root user to add users. Usually, /etc/passwd, /etc/group and /etc/shadow or /etc/master.passwd files are required for user account management.
Example: Add A User Called Tom Under UNIX
Create / add a user called tom with home directory, enter:# useradd -m tomSetup A Password For Tom
Type the following command:# passwd tomMake sure password must be 8 character long and include special characters and digits for security.
How Do I Add User Jerry To A Secondary Group Called Sales?
Type the following command:# useradd -G sales -m jerry
# passwd jerryHow Do I Add /bin/ksh as A Shell While Creating A User Account?
Use the following syntax:useradd -m -s /bin/ksh username
How Do I Setup HomeDirectory Path While Creating A User Account?
Use the following syntax:useradd -m -s /bin/ksh -d /path/to/home/user usernameYou can pass all those options as follows:
# useradd -d /nas/users/v/vivek -m -s /bin/bash -c "Vivek Gite" vivek
# passwd vivekFurther readings:
See useradd and passwd command man page:man useradd
man passwd
No comments:
Post a Comment