Remote root login prohibited under linux

First, add the same user and root privileges

   1、

    adduser admin

    passwd admin (Change Password)

 

 2, modify / etc / sudoers file and find the line, adding a line below the root, as shown in FIG.

  • vim /etc/sudoers 
  • ## Allow root to run any commands anywhere
  • root ALL=(ALL) ALL
  • admin ALL=(ALL) ALL

Second, the ban root remote login

You need to edit / etc / ssh / sshd_config.

vim / etc / ssh / sshd_config find PermitRootLogin

Instead  PermitRootLogin no

Restart service sshd restart

You just ban the root user login, do not prohibit other users to log in with another user, the root user su root cut back

To root password as input but also in

Guess you like

Origin www.cnblogs.com/hellohero55/p/12085060.html