1.1 KiB
1.1 KiB
As a linux user, we know the difference between a user having root privileges and users without. This is an important thing to understand. Sudo for the win.
There are 3 kinds of users on linux.
- Super user
- System user
- Normal user
Adding Users
Adding a user:
useradd usernamehere
Additional useradd
flags:
#creates a home directory for the user 'joe'
useradd joe -m
#creates a default shell for the user
useradd joe -m -s
#using the bash as default shell for user
useradd joe -m -s /bin/bash/
#adds user to the default user group
useradd joe -g users
#adds comments to the user
useradd joe -c "this dude sucks"
Putting it all together, making a user profile for Joe.
sudo useradd joe -m -s /bin/bash -g users -c "this dude sucks"
Many more flags are available but go to man
for additional info.
Setting a password for Joe.
sudo passwd joe
Removing Users
Removing a user:
userdel joe
Misc User stuff
View all users:
cat /etc/passwd