How to copy file from an SSH server to the local computer

On Linux systems, it is very easy to copy the files from one computer to another with the secure copy protocol.

Suppose you are logged into the server with SSH and you want to copy the file: /home/user/dummy.txt from the current server folder to your local path: /var/dummy.txt


Do the following steps:

  1. Exit from the ssh connection.
  2. Make sure that you are logged into your local machine.
  3. Execute the following command with the remote computer’s username and host name:
  4. You will be prompted for the password to connect with the server. Type the password to execute the secure copy operation.
  5. Your file from the remote server is now copied successfully to the local system. Make sure that the file is copied at the location /var/dummy.txt.