SSH Flashcards

1
Q

What is the purpose of SSH (Secure Shell)?

A

used to connect the remote server and execute commands remotely on a remote server. remote connection and remote execution.

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

Which package is required for SSH installation?

A

rpm -qa | grep openssh* will give
openssh-clients and openssh-server

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

How can you verify whether the necessary package for SSH is installed on your machine or not?

A

yum list installed | grep openssh* or rpm -qa | grep openssh*

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

What is the configuration file for the SSH server?

A

/etc/ssh/sshd_config

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

Which configuration file is associated with the SSH client?

A

/etc/ssh/ssh_config is the
configuration file for the client.

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

What steps can you take to ensure SSH remains persistent, active, and running?

A

systemctl enable sshd –now will start and enable sshd service

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

How would you confirm whether the SSH server's port (sshd) is actively listening or not?

A

netstat -tunap | grep 22 or netstat -tunap | grep sshd will show listen. lsof -i :22

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

What method would you use to display a list of all ESTABLISHED connections?

A

netstat -tunap | grep -i establish

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

How can you retrieve a list of security logs relevant to SSH?

A

grep -i sshd
/var/log/secure

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

How would you list all system logs pertaining to SSH?

A

grep -i sshd /var/log/messages

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

Which hidden directory contains files related to SSH authentication for a particular
user?

A

users home directory has a directory called .ssh

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

Name the file created during SSH authentication for any server containing fingerprints.

A

.ssh/known_hosts has the hostname, ip address and fingerprints. Fingerprints are recognition, unique.

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

How can you establish an SSH connection from server A to server B?

A

ssh
root@ipaddress or ssh user@ipaddress.

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

How can you execute a command from server A on server B without switching to
server B?

A

ssh user@ipaddress “command syntax” for example ssh user@ipaddress “touch file1”

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

How can we secure the system by disabling direct root logins through SSH?

A

vi into
/etc/ssh/sshd_config and edit PermitRootLogin from “yes” to “no”.

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

What are the various tools you have utilized for remote access and data transfer?

A

scp,
ssh, rsync, ftp/vsftp.

17
Q

You have received a support ticket indicating that a client is experiencing
unresponsiveness from the server and is unable to establish an SSH connection. How would
you approach troubleshooting this issue?

A

a. check ssh package – rpm -qa |grep openssh* or yum list installed | grep openssh*.
b. Check service status with systemctl status sshd.
c. Check if port is listening netstat -tunap | grep ssh.
d. Check TCP wrapper in /etc/hosts.deny.

18
Q

In a scenario with two hosts, A and B, a user requests assistance in setting up
passwordless SSH authentication. Where would the associated keys be stored?

A

in the users
home directory under .ssh

19
Q

If an attempt to SSH as the root user with the correct password proves unsuccessful, how would you go about diagnosing and resolving the problem?

A

check the /etc/ssh/sshd_config file for PermitRootLogin settings and permission.

20
Q

What is the significance of utilizing SSH key-based authentication?

A

we can access without password. we can execute commands without password, secure access, do not need to share root password

21
Q

Could you explain the process of modifying the SSHD port, and outline the steps to
allow this new port through the firewalld?

A

a. vi and change port in /etc/ssh/sshd_config.
b. Add port number to the firewall, firewall-cmd –add-port=1234/tcp –permanent.
c. firewall-cmd –reload.
d. setenforce 0.
e. systemctl reload/restart service.

22
Q

In the event that a service (specifically SSHD) fails to initiate, could you enumerate
some of the preliminary troubleshooting measures you might implement?

A

package, service,
port, tcp wrapper. check credentials for specific user. keys may be expired.

23
Q

What type of information is typically stored within the known_hosts file?

A

hostname, ip
address and fingerprints