1. 程式人生 > >centos7修改防火牆配置SSH訪問

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