How do I create a user in Linux?
The old school way is to use the command useradd.
Do this command to add user jsmith with a home directory:
sudo useradd -d /home/jsmith -s /bin/bash -m jsmith
Set the password for user jsmith by then issuing:
sudo passwd jsmith
It will then prompt you to type in a password and confirm by typing it in again.
Done!
Or you can use the command adduser:
sudo adduser jsmith Password: Adding user `jsmith’… Adding new group `jsmith’ (802). Adding new user `jsmith’ (802) with group `jsmith’. Creating home directory `/home/jsmith’. Copying files from `/etc/skel’ Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully Changing the user information for jsmith Enter the new value, or press ENTER for the default Full Name []: Room Number []: Work Phone []: Home Phone []: Other []: Is the information correct? [y/N] y
Done!
No related posts.

