Posted: . At: 8:36 AM. This was 2 years ago. Post ID: 16017
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.


How to add a new user on Linux and some other useful tips.


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.

https://securitronlinux.com/ubuntu-2/how-to-add-a-new-user-on-ubuntu-server-12-04-and-add-a-desktop-environment-if-desired/.

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

Leave a Comment

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