测试环境:
[root]# head -1 /etc/redhat-release
Red Hat Enterprise Linux Server release 5.3 (Tikanga)
|
【方法1】把普通用户的 uid 设置为 0
vi /etc/passwd
【方法2】设置普通用户 sudo 免输密码然后设置 alias
visudo
oracle ALL=(ALL) NOPASSWD: ALL
alias su='sudo su'
【方法3】修改文件 /etc/pam.d/su
vi /etc/pam.d/su
# Allow users 'su - root' without password
auth sufficient pam_permit.so
# Allow the user oracle 'su - root' without password
auth sufficient pam_succeed_if.so use_uid user = oracle
# Allow users in dba group 'su - root' without password
auth sufficient pam_succeed_if.so use_uid user ingroup dba
阅读(8690) | 评论(0) | 转发(0) |