[ubuntu-uk] Help needed with ssh

Robert McWilliam rmcw at allmail.net
Wed Jul 15 12:32:38 BST 2009

On Wed, Jul 15, 2009 at 10:44:03AM +0100, John Matthews wrote:
> This is something that I came across last night, whilst trying to upload 
> a file from my Dektop to my website using shell commands, or at least 
> trying to. Something that I found out after a while was that you need a 
> Terminal open for the Desktop and one for the Remote server. I just 
> could not get my Terminal to recognise that there was a file on my 
> desktp that needed to be transfered, kept saying no file found. This is 
> something that is really frustrating me that I couldnt get that to work, 
> which was why I asked about pc to pc help.

I'll try and give a simple explanation of how scp works, if anything
doesn't make sense or doesn't work come back to us (ideally with the
command you're trying to run that doesn't work). 

scp copies things from one place to another, normally with the two
places being on different machines. 

General usage is:
	scp <source> <destination>

For the simple case <source> and <destination> will both be files
(destination one that will be created), or you can give a directory
for destination and the file will be placed in it with the same name
as it had originally. They can be files on the same machine the
command is being run on (in which case they are referred to by the
path, e.g. /home/user/some.file) or on another machine (in which case
you need to specify the machine, user name and the path in the form
<user>@<machine>:<path>, e.g. john at example.com:/var/www/).

To copy something from your Desktop on an ubuntu machine to somewhere
on a webserver you'd want to run scp on the ubuntu machine, with
source as the path to the file and destination specifying the web
server. Something like:
	scp ~/Desktop/file_to.go john at example.com:/where/file/goes/

To get something from the remote server:
        scp john at example.com:/file/to.get ~/Desktop/

I think you might be confused about where you run these commands. If
the webserver is running an SSH server and your local machine isn't
then you should be running all the scp commands on your local
machine. You then refer to things on the local machine with normal
paths and stuff on the remote machine with paths with the server
address prepended. 

Hopefully that'll help some, if anythings not clear: ask.


Robert McWilliam            rmcw at allmail.net             www.ormiret.com

Speed the earth is orbiting the sun: ~65,000 miles per hour.  
Speed we orbit the galactic centre: ~600,000 miles per hour.

More information about the ubuntu-uk mailing list