Interview Questions


What is the difference between ssh and 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@

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@ "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

What is the command to access remote machine using SSH?

ssh remote_machine_hostname

Example: ssh

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