Skip to content

Instantly share code, notes, and snippets.

@catharsis96
Last active September 3, 2019 13:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save catharsis96/35e41c7b14d8d555ce6982ca61c4f0e5 to your computer and use it in GitHub Desktop.
Save catharsis96/35e41c7b14d8d555ce6982ca61c4f0e5 to your computer and use it in GitHub Desktop.
How to create a new user in Linux. Code to insert after "$" symbol
mami@mami:~$ sudo useradd testinguser
mami@mami:~$ sudo passwd testinguser
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
mami@mami:~$ sudo ls -l /home
total 20
drwxr-xr-x 55 alaa alaa 4096 Aug 22 22:00 alaa
drwx------ 2 root root 16384 Jun 5 09:46 lost+found
mami@mami:~$ sudo mkdir /home/testinguser
mami@mami:~$ sudo chown testinguser:testinguser /home/testinguser
mami@mami:~$ ls -l /home
total 24
drwxr-xr-x 55 alaa alaa 4096 Aug 22 22:00 alaa
drwx------ 2 root root 16384 Jun 5 09:46 lost+found
drwxr-xr-x 2 testinguser testinguser 4096 Aug 23 10:03 testinguser
mami@mami:~$ ls -l /home/testinguser/
total 0
mami@mami:~$ sudo chsh -s /biKn/bash testinguser
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment