useradd command examples
to add a new user using useradd command in the terminal type useradd followed by name of the username of the new user and enter
useradd centuser
To give new user a password use passwd command floowed by user name which will promt you to type new password to the user
passwd centuser
note that only root user are able change the password of the other users , none privileges user can only changed their own password
Define Custom Home Folder to New User
By Default When you add a new user , users home Folder created inside /home Directory, But you can Change Using -d option, For example lets create a user called centuser with /opt/centuser as home Directory
useradd -d /opt/centuser centuser
Add new user Without Home Folder
TO create new user a without a home Folder use -M option(Capital M)
useradd -M centuser
No comments:
Post a Comment