Advertisement

scp question

Started by November 20, 2005 10:00 AM
1 comment, last by haegarr 18 years, 10 months ago
I have a question regarding the scp command. I'm using ssh -l to log into a server, and I want to be able to transfer files there into my local pc. I know how to upload by using scp filename user@server:file, but when I want to downlaod, I don't know what the name of my local "server" is. Is there a default for this? I basically want to do: scp file username@my_computer.
Check out Drunken Brawl at http://www.angelfire.com/games6/drunken_brawl!
To copy files to the local machine, you don't need to specify a host or username.

For the currently logged-on user on the current machine, you can simply specify the name of a local file.

SCP can be used to upload or download (or indeed, both at the same time):

scp remoteusername@remotehost:/some/remote/file/path /some/local/file/pathscp /some/local/file/path remoteusername@remotehost:/some/remote/file/path # or evenscp remoteusername@remotehost:/some/remote/file/path anotherusername@anotherremotehost:/another/remote/file/path


Mark
Advertisement
In principal there is no difference whether you use the one way or the other. However, in fact it depends whether both computers are in the same network segment. And if not if your PC has an official (and hence reachable) IP number or not. And if your PC is behind a firewall, whether the ssh packets are routed to your local PC. And whether or not you are running a ssh damon on your local PC. And... I've forgotten some things, I bet :-)

Well, as you can see here, there are plenty of things to consider. One cannot answer your question w/o a deeper knowledge of your network situation.

What I can say: look into your local PC's network set-up for your IP number. Try to use it at the "server end" as name of the target computer, and look what happens. However, I assume it will not work...

EDIT: E.g. you _could_ login into a remote machine w/ an official IP even if self being behind a gateway/firewall and having an unrouted IP; but you may still not go the vice-versa way. I suggest you to stay on the local machine and try what markr said.

This topic is closed to new replies.

Advertisement