Saturday, September 15, 2012

// // Leave a Comment

How to copy files using SSH

you can't copy using the 'ssh' program specifically, but you can with it's associated programs: sftp or scp

sftp is (and works) similar to ftp

scp is a neat little program:


copy from a remote machine to my machine:
scp user@192.168.1.100:/home/remote_user/Desktop/file.txt /home/me/Desktop/file.txt

copy from my machine to a remote machine:
scp /home/me/Desktop/file.txt user@192.168.1.100:/home/remote_user/Desktop/file.txt

copy all file*.txt from a remote machine to my machine (file01.txt, file02.txt, etc.; note the quotation marks:
scp "user@192.168.1.100:/home/remote_user/Desktop/file*.txt" /home/me/Desktop/file.txt

copy a directory from a remote machien to my machine:
scp -r user@192.168.1.100:/home/remote_user/Desktop/files /home/me/Desktop/.



see 'man scp' or 'man sftp' for more ... 

hopefully there are no typos! :)