Adding a new user on Linux is very easy, this can be done with the groupadd and useradd commands. I am adding a new user group to Linux and then adding the new user to it.
Firstly, add the new user group.
jason@jason-Lenovo-H50-55:~$ sudo groupadd -g 1001 cudauser |
Then we may add the new user to it.
useradd -d /home/cudauser -s /bin/bash -m cudauser -u 1000 -g 1000 |
This is adding a new user and giving them a home directory as well.
This will also add all files from the /etc/skel folder to fill out the home directory.
All that remains is to add a password for the new user.
jason@jason-Lenovo-H50-55:~$ sudo passwd cudauser New password: Retype new password: passwd: password updated successfully |
You may also add a bunch of users to a Linux system as well.
And to see which groups your user is a member of, use this command.
cudauser@jason-Lenovo-H50-55:/home/jason$ groups cudauser |
This is how to get some information about your user.
jason@jason-Lenovo-H50-55:~$ w 08:35:13 up 41 min, 1 user, load average: 0.05, 0.01, 0.00 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT jason pts/0 192.168.1.5 07:57 0.00s 0.21s 0.01s w |