实验:基本的系统安全控制
实验环境
某公司新增了一台企业级服务器,已安装运行RHEL 6操作系统,由系统运维部、软件开发部、技术服务部共同使用。由于用户数量众多,且使用时间不固定,要求针对账号和登录过程采取基本的安全措施。
需求描述
- 允许用户radmin使用su命令进行切换,其他用户一律禁止切换身份。
- 授权用户zhangsan管理所有员工的账号,但禁止其修改root用户的信息。
- 授权用户lisi能够执行/sbin、/usr/sbin目录下的所有特权命令,不需要密码验证。
- 所有的su、sudo操作,必须在系统日志文件中进行记录。
- 禁止使用Ctrl + Alt + Del快捷键,只开放tty3、tty5终端,为GRUB引导菜单设置密码。
允许用户radmin使用su命令进行切换,其他用户一律禁止切换身份
配置
[root@test2 jason]#
useradd -g wheel
radmin
[root@test2 jason]# passwd radmin
Changing password for user radmin.
New password:
BAD PASSWORD: it does not contain enough DIFFERENT characters
BAD PASSWORD: is too simple
Retype new password:
passwd: all authentication tokens updated successfully.
创建radmin的同时,指定radmin的基本组是wheel
[root@test2 jason]# id radmin
uid=509(radmin) gid=10(wheel) groups=10(wheel)
这里能看出来在wheel的组内
[root@test2 jason]# cat /etc/group | grep wheel
wheel:x:10:xiao
这里有一个xiao用户,根据要求只能有radmin,所以删除这个组
[root@test2 jason]# gpasswd -d xiao wheel
Removing user xiao from group wheel
[root@test2 jason]# cat /etc/group | grep wheel
wheel:x:10:
可以看到wheel组当中已经没有了xiao这个用户
测试