Linux:系统管理和监视
- 创建用户
[root@localhost home]# adduser newuser - 删除用户
[root@localhost home]# passwd newuser - 修改用户属性
[root@localhost home]# id newuser
uid=501(newuser) gid=501(newuser) groups=501(newuser) - 增加用户组
[root@localhost home]# groupadd newgroup - 删除用户组
[root@localhost home]# groupdel newgroup - 修改组成员
[root@localhost home]# vi /etc/group - 用户之间的切换
[root@localhost home]# su - 修改用户属性
[root@localhost home]# usermod –g 502 newuser - 用户配置文件
[root@localhost home]# cat /etc/passwd
[root@localhost home]# cat /etc/shadow
[root@localhost home]# cat /etc/group
[root@localhost home]# cat /etc/gshadow - 显示用户自身的用户名
[root@localhost home]# whoami - 查询当前系统中都有哪些用户
[root@localhost home]# who - 更改文件的拥有者
[root@localhost home]# chown –R newuser:x - 更改文件的访问权限
[root@localhost home]# chmod g+s file - 进程查看命令
[root@localhost home]# ps - 删除进程
[root@localhost home]# kill –l 2506 - 系统监控命令
[root@localhost home]# top
[root@localhost home]# tree
[root@localhost home]# df - 查看当前用户的安全上下文
[root@localhost home]# id - 列出当前运行进程的安全上下文
[root@localhost home]# ps -Z - 列出文件对应的安全上下文
[root@localhost home]# ls –Z /etc/passwd - 查看当前SELinux模式及运行情况
[root@localhost home]# sestatus - 修改当前运行的SELinux模式
[root@localhost home]# setenforce enfoecing - 显示当前的DSELinux模式
[root@localhost home]# getenforce - 改变安全上下文
[root@localhost home]# chcon –t file - 初始化上下文
[root@localhost home]# setfiles file /etc/hosts - 恢复上下文
[root@localhost home]# restorecon - 标记文件系统
[root@localhost home]# Fixfiles check - 命令seinfo显示系统当前应用的SELinux策略情况
[root@localhost home]# seinfo - 命令sesearch用户查询规则的详细信息
[root@localhost home]# sesearch - 命令getsebool显示系统中布尔值的启动与关闭状态
[root@localhost home]# getsebool -a - 命令setsebool用于设置布尔值的状态
[root@localhost home]# setsebool –p 0 - SELinux的策略管理
[root@localhost home]# system-config-selinux