Monday, January 10, 2011

Copying data from server to PC on the same network

I am recently setup a server to host my "data" movies and music and such.

I was trying to copy the data back to my home computer using this command

scp files/on/server user@homecomputer:/home

the response was unknown user@computer, then i replaced with the ip address still same difference. How can i fix this?

Please and thank you.

  • Could you post the exact error message? Perhaps the user-name on your home computer is another one?

  • It's very unlikely that you have write access to /home (you'll need to specify something like /home/user instead).

    From JanC
  • Do you have the openssh-server package installed on the other computer?

    From frabjous
  • I can't give a definitive answer without knowing your network organization (which you should have described more precisely), but here's some information that may help you.

    You mention a “PC on the same network”, but also a “home computer”. Is your “home computer” really on the same network as the server? If not, maybe the home computer is behind a firewall and you can't initiate a connection from the server to the home computer, only from the home computer to the server. In particular, if the home computer is behind a NAT and the server is outside the NATed area, the server simply can't see the home computer.

    Other answers have noted potential problems with your command. If you had cut and pasted the exact error message (which you should have done), it would have been possible to tell whether these potential problems were actual problems.

    In any case, reverse ssh connections (i.e. ssh from home to server then back from server to home) are hard to manage (potential firewall trouble, potential authentication trouble, need to run an ssh server locally). So instead of initiating the copy from the server, initiate it from the home computer.

    Furthermore, scp is not a particularly good tool to copy a large number of files. If you want to make a one-time copy, or if you're always going to copy files from the server to the home computer and never the other way round, use rsync. If you want to keep the two computers synchronized, use unison — it's easier to use and less error-prone than rsync for two-way synchronization.

    From Gilles

0 comments:

Post a Comment