Configure and Secure SSH Flashcards

1
Q

What are the steps to set an idle timeout interval?

A
  1. Become Root
  2. Edit your /etc/ssh/sshd_config file and add the following line
  3. ClientAliveInterval 600
    ClientAliveCountMax 0
  4. systemctl restart sshd

Logged out when reaching 600 seconds (10 minutes)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the steps to disable root login (for ssh)?

A
  1. Become Root
  2. Edit your /etc/ssh/sshd_config file and replace PermitRootLogin yes to no
  3. PermitRootLogin no
  4. systemctl restart sshd
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the steps to disable empty passwords for ssh?

A
  1. Become Root
  2. Edit your /etc/ssh/sshd_config file and remove the # from the following line
  3. PermitEmptyPasswords no
  4. systemctl restart sshd
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the steps for limiting users and groups SSH access?

A
  1. Become Root
  2. Edit your /etc/ssh/sshd_confif file and add the following lines
  3. AllowUsers user1 user2
    AllowGroups group1 group2
  4. systemctl restart sshd
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the steps for changing the SSH port?

A
  1. Become Root
  2. Edit your /etc/ssh/sshd_config file and remove the # and change port on the following line
  3. Port 22
  4. systemctl restart sshd
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the steps to setup SSH keys?

A
  1. Generate the key
    ssh-keygen
  2. Copy the key to the server
    ssh-copy-id root@192.168.1.x
  3. Login from client to server
    ssh root@192.168.1.x
    ssh -l root 192.168.1.x
How well did you know this?
1
Not at all
2
3
4
5
Perfectly