
上QQ阅读APP看书,第一时间看更新
Disallowing root login
Some distributions deny root login by default, and this is widely considered a good idea. Here, we have a user (vagrant) that we can use to get around so that we don't need to log in as root.
Find the line with PermitRootLogin:
#LoginGraceTime 2m
#PermitRootLogin yes
#StrictModes yes
Change it to no:
#LoginGraceTime 2m
PermitRootLogin no
#StrictModes yes
Restart the SSH daemon:
[vagrant@centos2 ~]$ sudo systemctl restart sshd
This does not disallow local root login, so in a pinch, you can still connect to a console (or plug a keyboard and mouse into the physical machine) and log in with the root user locally.