Linux user management
2024-09-07 09:41:47 1 举报
AI智能生成
9/6
作者其他创作
大纲/内容
root
regular users
system (virtual) users
User Classification
/etc/passwd
/etc/group
/etc/shadow
Used as a template for new user home directories.
/etc/skel
User Files
useradd -u 12345 -s /sbin/nologin -M mysql
Add User
userdel
vim /etc/passwd# user
Delete User
id username
user exist?
grep username /etc/passwd
view user information
usermod -G root username
add user to root group
Modify User
Shows the current logged-in user
whoami
Displays user and group IDs and their names
id
cat /etc/passwd | grep username
uptime
who
w
Query Users
User account
sudo passwd username
Set or Change a User’s Password
sudo chage -m 7 -W 5 -I 15 username
Set Password Expiration Time
sudo chage -l username
password and account settings
set a password and expiration time
visudo=vim /etc/sudoers
Sudo Privilege Escalation
\m -fr file
/bin/rm file
unalias rm
force use rm
vim ~/.bashrc#rm
vim /etc/profileGoalias rm='echo pls do not use rm'
alias rm
Alias-Based Security Protections
Jump Server
history -cdelete history
history -wwrites the current shell's in-memory history to the history file (usually ~/.bash_history)
no bastion host
demo.jumpserver.org
Bastion Host
User Security
git bash
powershell
Xshell doesnt work
ssh -p 52113 root@10.0.0.202rzszscp
Additional Content
Linux user management
0 条评论
回复 删除
下一页