基础学习4-centos7修改防火墙配置SSH访问

1、修改selinux配置文件

#vim  /etc/sysconfig/selinux

# 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=enforcing #disabled禁用
# SELINUXTYPE= can take one of three two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected. 
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

2、配置SSH访问

允许访问

#vim /etc/hosts.allow

添加:sshd:192.168.10.0

禁止访问

#vim /etc/hosts.deny

添加:sshd:192.168.11.0

 

你可能感兴趣的:(linux)