Posted: . At: 10:04 PM. This was 7 years ago. Post ID: 10578
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.



Sponsored



How to create a new user on Linux with the command line.


Create a new user on Linux with the command line

Fairlight CMI media workstation with 5 1/4 inch drives.

Creating a new user on Linux with the command line is very easy. Just use the useradd command and this will be accomplished very easily.

Use this command to create a new user account.

ubuntu ~ $ sudo useradd -d /home/jeff -s /bin/tcsh -m jeff

Then set a password this way. If you try to set a password like this.

ubuntu ~ $ sudo useradd -d /home/jeff -p passwordjeff -s /bin/tcsh -m jeff

It will not work, you have to create the account first, then set the password afterwards.

ubuntu ~ $ sudo passwd jeff
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully

Then I can log in as the new user.

ubuntu ~ $ su jeff
Password:
ip-172-31-20-16:/home/ubuntu>

This is how easy it is to create a new user account on Linux with the useradd command. This could be used in a script to create a few accounts at a time.


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.