Users and Permissions Flashcards
Which file stores passwords in a salted hash
/etc/shadow
What is UID
User id
What is GID
Group id
What are the contents of the /etc/shadow file
- Username
- Password as a salted hash (* or ! on the password could denote that the account has been locked possibly because of invalid login attempts)
- Date of last password change
- Days until a change is allowed
- Days before a change is required
- Days of warning before expiration
- Days between expiration and deactivation
- Expiration date
- Special flag
What is the difference between an expired and deactivated account
An expired account will force you to change your password on the next login before you can complete the login.
A deactivated account will require an admin to reactivate the account before you can login again.
Create a new group
newgroup
How to show current user
whoami
How to show all ids for the current user (user id, group ids)
id
How to show all ids for the current user (user id, group ids) or a specific user
id
when entered alone it will display info for the current user
id username will show info for the specified user account
Create a new user
sudo adduser username
Create a new user
sudo adduser username
this works like a wizard and allows to enter more info
OR
sudo useradd -s /bin/bash -d /home/jason -m -G groupName userName
sudo passwd userName
Search for users on the system
grep ‘^username’ -ne /etc/passwd
will find a line in the passwd file that starts with username
Change/Set password for a user
sudo passwd username
See password info for a user
sudo passwd -S username
or
sudo chage -l username
Which command is used to set password policies for a user
sudo chage username
use man chage to see details