前言
最近换了CentOS6.X,多台主机之间相互打通SSH密钥之后,发现SSH/SCP命令依然需要输入passwd
是SELinux的问题,关闭SELinux即可解决问题,RHEL6.X 默认是开启状态
@Author duangr
@Website http://my.oschina.net/duangr/blog/181189
1.查看SELinux状态
[root@duangr-1 ~]# sestatus
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: enforcing
Mode from config file: enforcing
Policy version: 24
Policy from config file: targeted
2.暂时关闭,警告模式(重启后恢复)
[root@duangr-1 ~]# sestatus
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: permissive
Mode from config file: enforcing
Policy version: 24
Policy from config file: targeted
3.永久关闭(需要重启)
[root@duangr-1 ~] # vi /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
4.重启后查看SELinux状态
[root@duangr-1 ~]# sestatus
SELinux status: disabled