Configure and Secure SSH Flashcards
1
Q
What are the steps to set an idle timeout interval?
A
- Become Root
- Edit your /etc/ssh/sshd_config file and add the following line
- ClientAliveInterval 600
ClientAliveCountMax 0 - systemctl restart sshd
Logged out when reaching 600 seconds (10 minutes)
2
Q
What are the steps to disable root login (for ssh)?
A
- Become Root
- Edit your /etc/ssh/sshd_config file and replace PermitRootLogin yes to no
- PermitRootLogin no
- systemctl restart sshd
3
Q
What are the steps to disable empty passwords for ssh?
A
- Become Root
- Edit your /etc/ssh/sshd_config file and remove the # from the following line
- PermitEmptyPasswords no
- systemctl restart sshd
4
Q
What are the steps for limiting users and groups SSH access?
A
- Become Root
- Edit your /etc/ssh/sshd_confif file and add the following lines
- AllowUsers user1 user2
AllowGroups group1 group2 - systemctl restart sshd
5
Q
What are the steps for changing the SSH port?
A
- Become Root
- Edit your /etc/ssh/sshd_config file and remove the # and change port on the following line
- Port 22
- systemctl restart sshd
6
Q
What are the steps to setup SSH keys?
A
- Generate the key
ssh-keygen - Copy the key to the server
ssh-copy-id root@192.168.1.x - Login from client to server
ssh root@192.168.1.x
ssh -l root 192.168.1.x