So you are stuck in your CLI and want to copy files to and from your remote box to finish that all important project in Greenland or on the Bouvet islands.
What to do?
Enter SSH's brother secure copying; scp - if you have set up SSH with keys and pasword-less login it will work with scp too.
So here we go: to copy from a remote box:
Code: Select all
scp berserk@viking-pc:/home/berserk/berserkfiles/document.txt ~/berserkfiles/document.txt
This will copy document.txt from your remote berserfiles directory to your local berserkfiles directory.
To copy entire directories you can use the -r switch like this:
Code: Select all
scp -r berserk@viking-pc:/home/berserk/berserkfiles ~/
This will copy the berserkfiles directory to ~/
To copy to a remote box:
Code: Select all
scp ~/berserkfiles/document.txt berserk@remote-pc:~/berserkfiles/document.txt
If you are using other ports than 22 you will need to specify the port:
Code: Select all
scp -P 40065 ~/berserkfiles/document.txt berserk@remote-pc:~/berserkfiles/document.txt
Usefull stuff!