SSH Flashcards

1
Q

SSH config file

A

~/.ssh/config

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

~/.ssh/config

A

Must be readable and writable only by the user

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

Make ~/.ssh/config readable and writeable

A

chmod 600 ~/.ssh/config

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

SSH client reads its configuration in the following precedence order:

A

Options specified from the command line.
Options defined in the ~/.ssh/config
Options defined in the /etc/ssh/ssh_config

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

SSH config files: /etc/ssh/ssh_config

A

/etc/ssh/ssh_config

~/.ssh/config

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

ssh port:

A

Port 22

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

Change ssh default port:

A
  1. # sudo vim /etc/ssh/sshd_config
  2. Search for line with Port 22, remove the hash # and enter the new SSH port number.
    Port 5522
  3. # sudo systemctl restart sshd
  4. # ss -an | grep 5522
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Update ssh allowing login without password /passphrase

A
# ssh-agent bash 
# ssh-add ~/.ssh/id_rsa
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Add keygen at 4096

A

ssh-keygen -t rsa -b 4096

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

Create ssh rsa key

A

ssh-keygen -t rsa

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

Create and copy ssh key

A
  1. ssh-keygen -t rsa -b 4096
  2. ssh-copy-id user@172.980.34.200
  3. ssh user@IP
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Disable rootlogin

A

Step 1: # vi sshd_config

Step 2: Find: PermitRootLogin yes
change to: # PermitRootLogin

Step 3# systemctl restart sshd

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