Ubuntu – Problem with scp syntax

command lineremote accessscpssh

I am trying to copy a .tar archive from remote server to my pc.

Directory of the archive that I want to copy:

canserhan@embserv:~/tar_files/rtl_archive.tar

Destination:

serhan@serhan-Lenovo-B560:~/Documents$ 

I connect to remote server and use the command:

canserhan@embserv:~/tar_files$ scp canserhan@embserv:~/tar_files/rtl_archive.tar serhan@serhan-Lenovo-B560:~Documents$
Password:
ssh: serhan-Lenovo-B560: Name or service not known
lost connection
canserhan@embserv:~/tar_files$ 

There must be something wrong with the scp syntax I am using. However I could not figure it out. Could you please help me?

Thanks.

Best Answer

As a rule if you wanna send something to the remote server via scp:

scp some_files.tar user@remoteHost:
scp some_files.tar user@remoteHost:Documents/newname.tar

But if you wanna download something:

scp user@remoteHost:Documents/foo.tar ~/Desktop
scp user@remoteHost:/any/other/dir/foo.tar .
Related Question