Skip to content

Commit

Permalink
asdf
Browse files Browse the repository at this point in the history
  • Loading branch information
muzixiaoyao committed Dec 17, 2018
1 parent 7239119 commit 81a7e03
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions 系统(脱产)/Linux/17.远程访问服务ssh.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,29 @@ Port 10022

修改完整后保存退出,接下来修改selinux规则(开启selinux的情况下)

查看selinux是否开启

```shell
[root@localhost ~]# grep ^SELINUX= /etc/selinux/config
SELINUX=enforcing
## 如果selinux=enforcing就说明selinux是开启的,或者直接用下面命令查看
# sestatus
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: enforcing
Mode from config file: enforcing
Policy MLS status: enabled
Policy deny_unknown status: allowed
Max kernel policy version: 28
## 临时关闭selinux的方法
# setenforce 0
## 永久关闭selinux必须修改/etc/selinux/config中SELINUX=disable,这个修改在重启后生效
```

selinux尽量不要关,在selinux开启的状态下我们使用以下命令添加ssh访问的端口

```shell
# yum install policycoreutils-python
# semanage port -l |grep ssh
Expand Down

0 comments on commit 81a7e03

Please sign in to comment.