After doing some security audits of servers, xFusionCorp Industries security team has implemented some new security policies. One of them is to disable direct root login through SSH.
Disable direct SSH root login on all app servers in Stratos Datacenter.
Answer:
#we need to login each app server and set PermitRootLogin to (no) in the sshd config file
#login to server
ssh <user>@<server>
# switch to root user
sudo su
# before chnage, first verify using below command or you can simply cat the sshd_config file ans find the entry PermitRootLogin
cat /etc/ssh/sshd_config | grep PermitRootLogin
# edit the file and do the change and save it
vi etc/ssh/sshd_config
press i to switch insert mode and edit line as below and make sure that you remove # in front of the line.
PermitRootLogin no
#save the file
press Esc and wq!
# you must restart the sshd service otherwise task change will not work.
systemctl restart sshd
* do the above steps for all the app servers
No comments:
Post a Comment