Interview Questions

SSH

What is the difference between ssh and scp?

SSH SCP
SSH is used for secure connection between hosts for command execution SCP is used for secure connection between hosts for file transfer operation

What is the algorithm used by SSH?

SSH uses RSA public key cryptography for authentication and connection between systems.

How will you trasfer file using SSH?

SSH File transfer is performed using SCP command.

SCP stands for Secure Copy. It performs file transfer using SSH connections.

How to specify your machine port while using SCP command?

scp -p local_user_name@localhost:/file_path remote_user@remote_server_ip:/remote_server_path

What is the command to copy file from local machine to remote machine using SCP?

scp local_user_name@localhost:/file_path remote_user@remote_server_ip:/remote_server_path

Example: scp sibi@localhost:/tmp/test.txt root@1.2.3.4:/tmp/destDir

What are the different operations of SCP?

Using SCP, you can perform the following operations.

1. Copy file from local system to remote system

2. Copy file from remote system to local system

3. Copy file from one remote system to another remote system

How to execute commands in remote machine using SSH ?

ssh user_name@remote_machine_hostname "ls -ltr"

Example: ssh root@1.2.3.4 "ls -ltr"

What is the command to access remote machine running in non-default SSH port?

ssh -p port_number remote_machine_hostname

Example: ssh -p 1055 1.2.3.4

What is the command to access remote machine using SSH?

ssh remote_machine_hostname

Example: ssh 1.2.3.4

What are the features of SSH?

1. Access the remote machine securely
2. Very good authentication mechanism (e.g, Public Key authentication)
3. Secure File transfer
4. X-Session forwarding
5. Port forwarding