SSH Flashcards

1
Q

Where you will look into if user can’t SSH and can’t log into the system?

A

/var/log/secure

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

Why do you need an ssh-key based entry?

A

Key-based authentication provides two primary benefits:
*helps mitigate brute-force password attacks against SSH.
*prevents administrators from being required to manually type password in automated process such as scripts or sensible.

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

How to ensure SSH is persistent, and running/active , how do you check if SHHD is listening or not?

A
  • systemctl enable sshd for persistent
    *systemctl is-enabled sshd
    *systemctl is-active
    *Systemctl status sshd
  • netstat -tunap | grep sshd of is listing or not
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do you change the port for sshd, and how would you allow the port in firewalld?

A
  • vi/etc/ssh/ssh_config
    *firewall-cmd –add-port=3456/tcp –permanent
    *firewall-cmd –add-service=ssh/tcp –permanent
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What command you use to list all the security/system logs that pertain to ssh?

A

For security
/var/log/secure
For system logs
var/log/messages | grep ssh

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

How can we disabled direct root login on to the system by using SSH?

A

*vi /etc/ssh/sshd_config
*permitroot login on
Systemctl restart sshd

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

Trying to ssh as root and put in correct root password and it’s not working; how would you troubleshoot that?

A

Check if the root login is enabled
Grep permit /etc/ssh/sshd_config

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

A client’s is asking server is responding. He can’t ssh, what you will do to fix it?

A

First thing is to identify where the problem lies . If it’s the client or the host.
Taking in consideration that both of us we are connected.
*check if sshd service is running
*check systemctl sshd status
*port is listening
*firewalld is permitting

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

A service sshd fails to start. What are some of the troubleshooting steps you’d take?

A

Systemctl status sshd
Jounalctl -u sshd
Grep sshd /var/log/messages
Check the configuration file
/etc/ssh/sshd_config for any errors
Check if fiwerewall permits
Port is allow
Host ip address is allowed

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

How will you list all the ESTABLISHED connections?

A

netstat -tunap | grep ESTABLISHED

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

How do you change the port for sshd, and how would you allow that port in firewalld?

A

firewall-cmd –add-port=80/tcp –permanent
firewall-cmd –reload

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

how do you list kernel logs /boot up logs?

A

cat /var/log/dmesg

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