SSH登陆到终端的时候去掉Your default context is root提示

来源:互联网 发布:js模仿360加速球效果 编辑:程序博客网 时间:2024/05/23 05:09
文章来源:http://www.2hei.net/mt/2009/07/your-default-context-is-root.html


[local@2hei.net ~]$ su - 
Password: 
Your default context is root:system_r:unconfined_t. 


Do you want to choose a different one? [n]


[root@2hei.net ~]# getenforce
Permissive


解决办法一:
[root@2hei.net ~]#  vi /etc/pam.d/su  


session           required     /lib/security/$ISA/pam_selinux.so open multiple
改成
session           required     /lib/security/$ISA/pam_selinux.so open


解决办法二:
vi /etc/selinux/config
# SELINUX= can take one of these three values:
#       enforcing - SELinux security policy is enforced.
#       permissive - SELinux prints warnings instead of enforcing.
#       disabled - SELinux is fully disabled.

SELINUX=permissive
改成
SELINUX=disabled


重启系统或者使用以下命令使SElinux生效
setenforce 0


使用getenforce查看结果是否生效
原创粉丝点击