Linux
Linux
# who
# last
# w
# users
--------------------
k- Managing Users
- Essential files for users and groups
/etc/passwd
/etc/group
/etc/shadow
/etc/gshadow
/home/{username}
/etc/skel => contains default files home for new users
/etc/login.defs
/etc/sudoers
- modify user
- change the user home directory
# usermod -d /new/directory {user}
- Managing groups
- add new group with id
# groupadd {groupname}
# groupadd {groupname} -g {GID}
- delete group
# groupdel {groupname}
- password aging and get more information about the user's passwords
- option as :
- {-m days => set the min number of days password to change}
- {-M days => set the max number of days password need to change}
- {-W days => set the number of days to warn changing the password
- { -I days => Sets the number of inactive days after a password expires
before the account is locked
- {-E data => Sets an account expiration date in the format YYYY-MM-DD }
- Locking an account
# passwd -l username
# usermod -s /sbin/nologin username => change shell dir
# usermod -s /bin/false username
- Unlocak an account
# passwd -u username
+201003425890
[email protected]
`
------------------------------
- execute(x) => 1
- write (w) => 2
- read (r) => 4
- user catagory
- Owner
- Group
- Others
# ls -lah
(-rwxrw-r-- 1 root root 730 Jul 28 07:39 test.txt)
- 1th field: show if it is direcroty (d) or file
- 3 fields ( 2th,3th,4th) are related to Owner
- 3 fields (5th,6th,7th) are related to Group
- 3 fields (8th,9th,10th) are related to Others
- to remove prevention
# chattr -i filename
- No-Access Time (A): Prevents the file access time from being updated
# chattr +A filename