关闭SELinux

本文介绍了如何在 CentOS6.X 系统中通过关闭 SELinux 解决 SSH 和 SCP 命令仍需输入密码的问题。通过查看 SELinux 状态、暂时关闭并设置为警告模式,最终实现永久关闭 SELinux 并确保系统的安全性和命令执行效率。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

前言

最近换了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


转载于:https://my.oschina.net/duangr/blog/181189

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值