Personal tools
You are here: Home Wiki Scp
Views
Scp copied.

scp or secure copy ('s'ecure remote ''c''o''p''y'' program)

The scp program is part of (most) ssh distributions, and it is a drop-in replacement for rcp, and a suitable replacement for ftp much of the time. Like other ssh tools, it indicates remote files/directories with the string username@remotehost:/path.

username is the user-account that you use to log in to the remote machine.

remotehost is the hostname of the remote machine, resolvable via /etc/hosts or DNS, or even the IP address.

/path is the path to the directory or files on the remote machine that you're referring to. It can be an absolute path, in which case it would start with a slash, or it can be a relative path (to your home directory), in which case it wouldn't start with a slash.

How do I copy files from my local machine to a remote machine using scp?

scp ./some/directory/foo username@example.com:/some/other/directory/

How do I copy files from a remote machine, to my local machine?

scp username@example.com:/some/directory/foo /local/path/to/foo

How does copying a file from one remote host to another remote host work?

scp username@example.com:file other@example.org:/new/path/and/filename

scp first logs into example.com, then initiates the scp to example.org.

How do I copy an entire directory?

scp -R ./some/directory username@example.net:/some/other/directory

The ''-R'' tells scp to do a ''recursive'' copy.



Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: