linux服务器防止任何人使用su命令成为root用户
2014-04-09 11:01
423 查看
linux服务器防止任何人使用su命令成为root用户
指定只有某个用户才可以使用su命令到root用户
实现方法:
1.vi /etc/pam.d/su
打开注释
# auth required pam_wheel.so use_uid
echo "SU_WHEEL_ONLY yes" >> /etc/login.defs
2.usermod -G 10 lndy //把lndy用户加入到wheel组
[root@localhost ~]# id landy
uid=500(lndy) gid=500(lndy) groups=500(lndy),10(wheel) context=root:system_r:unconfined_t:SystemLow-SystemHigh
[root@localhost ~]# id xxl
uid=501(xl) gid=501(xl) groups=501(xl) context=root:system_r:unconfined_t:SystemLow-SystemHigh
lndy用户可以su到root,而xl用户不可以su到root
[lndy@localhost ~]$ su -
Password:
[xl@localhost ~]$ su -
Password:
su: incorrect password
本文出自 “梦女孩” 博客,请务必保留此出处http://dreamgirl1314.blog.51cto.com/1159474/1392642
指定只有某个用户才可以使用su命令到root用户
实现方法:
1.vi /etc/pam.d/su
打开注释
# auth required pam_wheel.so use_uid
echo "SU_WHEEL_ONLY yes" >> /etc/login.defs
2.usermod -G 10 lndy //把lndy用户加入到wheel组
[root@localhost ~]# id landy
uid=500(lndy) gid=500(lndy) groups=500(lndy),10(wheel) context=root:system_r:unconfined_t:SystemLow-SystemHigh
[root@localhost ~]# id xxl
uid=501(xl) gid=501(xl) groups=501(xl) context=root:system_r:unconfined_t:SystemLow-SystemHigh
lndy用户可以su到root,而xl用户不可以su到root
[lndy@localhost ~]$ su -
Password:
[xl@localhost ~]$ su -
Password:
su: incorrect password
本文出自 “梦女孩” 博客,请务必保留此出处http://dreamgirl1314.blog.51cto.com/1159474/1392642
相关文章推荐
- 禁止任何人通过su命令改变为root用户
- 禁止普通用户使用su命令切换到root用户
- Linux Ubuntu下使用su命令切换root用户
- 【Linux安全】防止任意用户使用 su 切换到 root
- 用户密码管理、mkpasswd命令、su命令、sudo命令、限制root远程登录
- 只允许wheel组到用户才能使用 su命令
- linux 切换到 root 用户 [su命令,sudo命令]
- 建立普通用户且只有wheel组才能使用su登陆为root
- 命令在root用户下无法使用
- sudo以root身份执行命令与su切换用户命令
- SecureCRT使用图形程序故障(root用户su登录oracle用户)
- su命令,sudo命令,限制root用户的远程登录
- 关于使用su切换用户之后,命令无法…
- su命令和sudo命令,以及限制root用户登录
- Linux禁止非WHEEL用户使用SU命令
- Linux禁止普通用户使用su 切换到root 用户
- Mac Air Ubuntu 登陆界面无限循环问题 以及 root用户无法使用命令问题
- Linux禁止非WHEEL用户使用SU命令
- 关于使用su切换用户之后,命令无法…