Connecting to localhost (localhost)|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 10918 (11K) [text/html]
Saving to: 'index.html'
index.html 100%[===================>] 10.66K --.-KB/s in 0s
2020-05-28 21:03:39 (109 MB/s) - 'index.html' saved [10918/10918]
Example 2 Denying ssh client from remote login with root
The following figure shows how to deny ssh remote login permission for a root user.
Figure 18. ssh remote permission
1. root: config sshd to permitrootlogin
$ setenforce 0
$ vi /etc/ssh/sshd_config
Find “PermitRootLogin prohibit-password” and change it to “PermitRootLogin yes”
2. root: restart ssh server
$ systemctl restart ssh
Now root should be allowed to access the system from remote side with ssh.
3. root: turn on SELinux and ssh.
$ setenforce 1
$ ssh root@localhost
/bin/bash: Permission denied
Connection to localhost closed.
Even though sshd_config file has permitted root login but still fails in ssh.
4. root: turn on ssh login boolean
NXP Semiconductors
Industrial features
Open Industrial User Guide, Rev. 1.8, 05/2020
User's Guide
66 / 199