可以通过以下简单的方法,在HP-UX中(其实其他的UNIX系统也可以借用此方法)限制只让某些用户su成root用户: 1. 在/etc/security中加一行,如下: su_root_GROUP=super 2. 在/etc/group中加一行,如下: super::75:root,test1,test2 经过这样限定以后,只有组内的人可以su成root用户。 Ref: http://blog.chinaunix.net/u/12718/showart_66285.html 本文来自ChinaUnix博客,如果查看原文请点:http://...
可以通过以下简单的方法,在HP-UX中(其实其他的UNIX系统也可以借用此方法)限制只让某些用户su成root用户: 1. 在/etc/security中加一行,如下: su_root_GROUP=super 2. 在/etc/group中加一行,如下: super::75:root,test1,test2 经过这样限定以后,只有组内的人可以su成root用户。 本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/12718/showart_66285.html
以普通用户登入后想运行inetd,于是 $su root password: #inetd sh:inetd:not found #who user 0:00 /dev/tty0 bin/sh #logout $who user 0:00 /dev/tty0 usr/bin/who 这是什么原因?为什么使用su后仍然不能得到root的权限? 谢谢帮助!
禁止任何人通过su命令改变为root用户 su(substitute User替代用户)命令允许你成为系统中其他已存在的用户。如果你不希望任何人通过su命令改变为root用户或对某些用户限制使用su命令,你可以在su配置文件(在"/etc/pam.d/"目录下)的开头添加下面两行: 编辑su文件(vi /etc/pam.d/su),在开头添加下面两行: auth sufficient /lib/security/pam_rootok.so debug auth required /lib/security/Pam_wheel.so group=whee...
通常我们在限制普通用户su成root用户时,用PAM的方法虽然能够完成这项功能,但使所有用户都不能互相su了,这就给工作造成了影响,因为有一些公共帐号需要使用,经过若干次尝试,终于成功了,希望对你们有帮助. 1 在/etc/pam.d/su中设置: auth sufficient /lib/security/pam_listfile.so item=user sense=deny onerr=succeed file=/etc/sudeny auth required /lib/security/pam_wheel.so group=wheel 2 在/etc/sudeny中添加用户root
sutoroot.sh 脚本: #-----------------------------------------------# #!/usr/bin/expect # # su to root without entering password manually ! # spawn su - expect "Password:" send "lovexia\r" expect eof #-----------------------------------------------# 执行的情况: [nic@lovexia ~]$ who am i nic pts/0 2008-09-19 02:30 (192.168.2.81) -----> 用户为nic [nic@lovexia ~]$ ./sutoR...