Transferring files with OpenSSH

Posted by Anonymous on Mon 11 Oct 2004 at 12:49

OpenSSH is a well known program which allows you to login to a host remotely, and run commands etc. It also comes with a simple file transfer system which can be used to transfer files securely.

scp is the command to use. You can either transfer files to the remote machine from your local one, or vice versa.

Usage is as simple as:

scp file-to-send user@host:/path/to/place/file

For example to copy the password file from your local machine (bennevis to a remote server called 'earth' you could use:

steve@bennevis:~$ scp /etc/passwd steve@earth:
steve@earth's password:
passwd               100% |*****************************|   918       00:00

As no destination directory was specified the file will be transferred to your home directory upon the remote machine.

If you wish to transfer a lot of files you can copy a directory recurisvely, with the -r flag.


When it comes to sending files to and from you Unix machine from a Windows desktop you can use the excellent open source program WinSCP which presents a drag and drop interface to remote file systems - allowing you to drag and drop files with ease.

With OpenSSh installed you have no reason to be running insecure systems such as FTP to copy files to and from your Unix servers.


This article can be found online at the Debian Administration website at the following bookmarkable URL:

This article is copyright 2004 Anonymous - please ask for permission to republish or translate.