SSH Flashcards
What is the purpose of SSH (Secure Shell)?
used to connect the remote server and execute commands remotely on a remote server. remote connection and remote execution.
Which package is required for SSH installation?
rpm -qa | grep openssh* will give
openssh-clients and openssh-server
How can you verify whether the necessary package for SSH is installed on your machine or not?
yum list installed | grep openssh* or rpm -qa | grep openssh*
What is the configuration file for the SSH server?
/etc/ssh/sshd_config
Which configuration file is associated with the SSH client?
/etc/ssh/ssh_config is the
configuration file for the client.
What steps can you take to ensure SSH remains persistent, active, and running?
systemctl enable sshd –now will start and enable sshd service
How would you confirm whether the SSH server's port (sshd) is actively listening or not?
netstat -tunap | grep 22 or netstat -tunap | grep sshd will show listen. lsof -i :22
What method would you use to display a list of all ESTABLISHED connections?
netstat -tunap | grep -i establish
How can you retrieve a list of security logs relevant to SSH?
grep -i sshd
/var/log/secure
How would you list all system logs pertaining to SSH?
grep -i sshd /var/log/messages
Which hidden directory contains files related to SSH authentication for a particular
user?
users home directory has a directory called .ssh
Name the file created during SSH authentication for any server containing fingerprints.
.ssh/known_hosts has the hostname, ip address and fingerprints. Fingerprints are recognition, unique.
How can you establish an SSH connection from server A to server B?
ssh
root@ipaddress or ssh user@ipaddress.
How can you execute a command from server A on server B without switching to
server B?
ssh user@ipaddress “command syntax” for example ssh user@ipaddress “touch file1”
How can we secure the system by disabling direct root logins through SSH?
vi into
/etc/ssh/sshd_config and edit PermitRootLogin from “yes” to “no”.