Question:
Following security audits, the xFusionCorp Industries security team has rolled out new protocols, including the restriction of direct root SSH login.
Your task is to disable direct SSH root login on all app servers within the Stratos Datacenter.
Solution:
# SSH to App server 1
ssh tony@stapp01
# Disable root login
sudo vi /etc/ssh/sshd_config
Change to: PermitRootLogin no
# You can check the syntax of the ssh file with
sudo sshd -t
# Restart the ssh service
sudo systemctl restart sshd
Repeat the same for App server 2
ssh steve@stapp02
sudo vi /etc/ssh/sshd_config
Change to: PermitRootLogin no
sudo sshd -t
sudo systemctl restart sshd
Repeat the same for App server 3
ssh banner@stapp03
sudo vi /etc/ssh/sshd_config
Change to: PermitRootLogin no
sudo sshd -t
sudo systemctl restart sshd
Now we can check from jump host
ssh root@stapp01
root@stapp01's password:
Permission denied, please try again.
ssh root@stapp02
root@stapp02's password:
Permission denied, please try again.
ssh root@stapp03
root@stapp03's password:
Permission denied, please try again.
