The method of prohibiting remote login of root user under Linux and creating a user to allow sudo privileges

1) vi /etc/ssh/sshd_config, change the value of PermitRootLogin to no, and save

2)service sshd restart

 

In this way, you can use root to disable ssh login.

 

Create a user to allow sudo privileges ------

Create a user eg: #useradd master

Set password: #passwd master

Add the master account with sudo permissions, as follows:

#visudo

join in

master   ALL=(ALL)   NOPASSWD: ALL  

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326077580&siteId=291194637