Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to copy a file from my other computer, to another computer. (both running Ubuntu 9.10)

So, I've ssh'ed into the other computer; I cd to the directory; and I entered cp /home/me/Desktop as is located in the directory I just used cd with.

Now, it gives me the following error message:

cannot create regular file '/home/me/Desktop': no such file or directory

What do I have to do?

share|improve this question

migrated from Jan 6 '10 at 17:51

This question came from our site for professional and enthusiast programmers.

up vote 26 down vote accepted

This isn't really programming related, but you can use scp to do this.

scp remote-box-name:/path/to/destination/

If your username is different on the remote box, you will need to prefix it:

scp yourusername@remotebox:/path/to/destination/

And to retrieve a file you could do this:

scp remotebox:/path/to/destination/
share|improve this answer
how does that work when i am sshed into the other computer on the computer where i want to copy the file to? Because when i try like scp, it says 'connection refused', probably because it is the computer im on. How to? – Deniz Zoeteman Jan 6 '10 at 18:15
The syntax is src_file dest_file, where either can be just a filename on a local computer (, or a remote file ( So if you want to pull a files from a remote machine to the local machine, you would do scp Note that local and remote are relative to the machine you are running the scp. So if you are on machine A, ssh to machine B and do an scp, B is local and A is remote. – KeithB Jan 6 '10 at 18:23
It still gives the same error as i shown in the question – Deniz Zoeteman Jan 6 '10 at 18:34
when i try to do it from local machine, it says 'no route to host' or something like that... probably because it is protected with a password. – Deniz Zoeteman Jan 6 '10 at 18:38
sftp is another good option if you're comfortable with ftp and are doing this manually. – Brian Knoblauch Jan 6 '10 at 20:08
  1. On machine A, open two terminal windows

  2. On machine A, ssh to machine B. Look around, find the path on machine B to the file you wish to copy

  3. On machine A, the second terminal window type:

scp yourusername@remotebox:/path/to/destination/ /home/me/Desktop

The file should be copied from machine B to machine A, in to the /home/me/Desktop folder (if the folder exists on Machine A

You can't copy over the existing ssh session. You need to create a second session. As others have noted:

  • yourusername is for Machine B, and is only needed if the username for Machine B is different than on Machine A

  • remotebox can be a resolvable name or an IP address


  • Places -> Connect to Server, and then select Service Type of SSH from the pulldown menu of the Connect to Server dialog box
share|improve this answer
if i want to copy a folder ? how – shareef Jul 6 '15 at 8:32

you need to use scp to either pull or push the file. From one machine to the other, you'd do something like

scp username@ipaddress:/home/me/Desktop/

share|improve this answer

try the following command:

scp username@AnotherComputer:~/

share|improve this answer

Mount remote machine locally with sshfs and copy files with your favorite tool- cp, nautilus, konqueror, dolphin, mc etc.

or use fish://username@servername in konqueror or dolphi top open the remote location

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.