CentOS enables sudo method

  

CentOS does not enable sudo by default, and can log in to the server directly as a super administrator. Ubuntu has done a good job in this regard. In order to reduce the loss caused by misoperation, it is recommended to enable sudo.


1. Add sudo user Execute the visudo command and find:

root ALL=(ALL) ALL

Add in the following:

centos ALL=(ALL) ALL


2. Disable root user login Edit /etc/ssh/sshd_config will

PermitRootLogin yes

For

PermitRootLogin no


3, restart sshd:

service sshd reload

Copyright © Windows knowledge All Rights Reserved