Linux Users
- New User
- Check User
- Set Password For Self
- Set Password Different User
- Create System Account
- Delete User
- /etc/passwd File
- Related
- Links
New User
Add new user.
Depending on the distribution it may or may not create a home directory.
The configuration can be seen under /etc/default/useradd.
The new account will have a UID above 1000
sudo useradd xxx
Add new user & explicitly create a home directory.
sudo useradd -m xxx
Check User
If the user was created successfully it will have an entry in the /etc/passwd file
cat /etc/passwd | grep -i 'xxx'
Set Password For Self
sudo passwd xxx
Set Password Different User
sudo passwd
Create System Account
Create a System Account
The new account will have a UID below 1000
Most distributions will not display this user on the logon screen
sudo useradd -r sysuser
Delete User
Delete user leaving the home directory behind.
sudo userdel xxx
Delete user and its related resources
sudo userdel -r xxx
/etc/passwd
Lists all the users on the system. Also
user:x:1000:1000:user:/home/u:/bin/bash
- Column: UserName
- Column: Password( Historically ) Modern systems have a hashed password located at /etc/shadow
- Column: UID
- Column: GID
- Column: Gecos / User Information / Name ( Optional Field)
- Column: Home directory
- Column: Shell
/etc/shadow
user:$6$8dkZRIbbknoLsEgGjhgjyg786876V4w6UFwph:18390:0:99999:7:::
- Column: Username
- Column: Password Hash
- Column: Days since Unix Epoch since password was last changed
- Column: Days until the password can be changed again.
- Column: Days until a password change is required since Unix Epoch
- Column: Days before password expires that the user will be reminded to change password.
- Column: Days until user password will be locked
- Column: Days until account will be disabled
Related
- Linux Groups
- Create a Password Hash
- Hashing in Windows
- Working With SSH Keys
- Open Source – andOTP – Android OTP Authenticator
- LUKS: Linux Unified Key Setup Essentials
Links
- https://en.wikipedia.org/wiki/Epoch_(computing)