Learn the Shell – How to Copy file over SSH

Hello everyone, on this tutorial I am going to show you some example on how to copy file over SSH. By learning this, you will be able to easily copy a file from local computer to remote one and vice versa. All can be done using Shell command via scp command. There is no special skills needed in order to be able to copy files over ssh. But a better understanding about SSH, Shell Commands are better.

On this tutorial, I use the following hosts:

  • Local computer: 10.34.0.247
  • Remote Computer: 10.34.0.166

First, we will list any files inside a directory.

As you can see my current directory has 2 files:  file1.txt and anaconda-ks.cfg

Now we will copy the file1.txt to the remote host using scp command

If this is the first time you connect to the remote host, you will need to confirm the authenticity of host as above. Type yes and press enter. The command will copy file1.txt to /home/dhani/ on the remote host. You can modify the command above to match your current needs.

Be the first to comment

Leave a Reply

Your email address will not be published.


*