Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

So say:

I've ssh'ed into the other computer; i 'cd' to the directory; and i entered cp File.zip /home/me/Desktop as file.zip 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 stackoverflow.com Jan 6 '10 at 17:51

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

5 Answers 5

up vote 23 down vote accepted

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

scp file.zip remote-box-name:/path/to/destination/file.zip

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

scp file.zip yourusername@remotebox:/path/to/destination/file.zip

And to retrieve a file you could do this:

scp remotebox:/path/to/destination/file.zip file.zip
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 file.zip me@xxx.xxx.xx.xxx:/home/me/Desktop, 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 (file.zip), or a remote file (me@xxx.xxx.xx.xxx:/home/me/Desktop). So if you want to pull a files from a remote machine to the local machine, you would do scp xxx.xxx.xx.xxx:/home/me/Desktop/file.zip file.zip. 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/file.zip /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

Alternatives:

  • 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

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

scp File.zip username@ipaddress:/home/me/Desktop/file.zip

share|improve this answer

try the following command:

scp File.zip 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

 
discard

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.