SSH Flashcards
Where you will look into if user can’t SSH and can’t log into the system?
/var/log/secure
Why do you need an ssh-key based entry?
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 to ensure SSH is persistent, and running/active , how do you check if SHHD is listening or not?
- 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 do you change the port for sshd, and how would you allow the port in firewalld?
- vi/etc/ssh/ssh_config
*firewall-cmd –add-port=3456/tcp –permanent
*firewall-cmd –add-service=ssh/tcp –permanent
What command you use to list all the security/system logs that pertain to ssh?
For security
/var/log/secure
For system logs
var/log/messages | grep ssh
How can we disabled direct root login on to the system by using SSH?
*vi /etc/ssh/sshd_config
*permitroot login on
Systemctl restart sshd
Trying to ssh as root and put in correct root password and it’s not working; how would you troubleshoot that?
Check if the root login is enabled
Grep permit /etc/ssh/sshd_config
A client’s is asking server is responding. He can’t ssh, what you will do to fix it?
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
A service sshd fails to start. What are some of the troubleshooting steps you’d take?
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 will you list all the ESTABLISHED connections?
netstat -tunap | grep ESTABLISHED
How do you change the port for sshd, and how would you allow that port in firewalld?
firewall-cmd –add-port=80/tcp –permanent
firewall-cmd –reload
how do you list kernel logs /boot up logs?
cat /var/log/dmesg