Question:how to use scp unix command on command line?


Scp is useful in conjunction with tar. It allows you to securely copy a file from one server to another. To do this you must know the address of your destination server and you must have a username and password for a user with write privileges in the location you want to put the file. For this example, say I want to move that tarball I created earlier to a server ‘’ and I have write privileges with the user ‘myuser’ and password ‘mypassword’:

scp mytarball.tgz

You would then be prompted for the password of ‘myuser’. This would copy the file to the directory /home/myuser on the host server. If you were on the host server already and wanted to copy a file from a remote server you would do:

scp .

You would then be prompted for that users password. This would copy the file ‘filetocopy.txt’ from a remote server to your current director. This is essentially ‘getting’ a file whereas the first example was ‘putting’ a file.

asked Sep 13, 2013 in LINUX by anonymous
edited Sep 12, 2013
0 votes

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.