SCP issues over SSH... can't seem to copy from remote to local.
Code:
root:# ls As you can probably tell from the output above, I'm trying to perform a recursive copy of all the files (images) contained in /home/john/Pictures to "." (which I'm assuming is the "current local directory"). I can't wrap my head around the man pages (all the brackets are confusing the crap out of me!). Basically, I run the command and it obviously works... but it performs the copy to the current REMOTE directory. So what parameter(s) do I need to use in order to copy to my LOCAL machine? Thanks a TON, guys! Any help is appreciated!! EDIT: Also, I've tried to use the follow command to no avail. The prompt hangs and I have to CTRL-Z out of it. Code:
scp -r /home/john/Pictures dividebyzer0@192.168.1.5:/home/dividebyzer0/Desktop It is my understanding that SCP should work as follows... Code:
scp foobar.txt your_username@remotehost:/some/remote/directory |
SCP has no knowledge that it is being run within an SSH session. Let's say I wanted to copy some files from /home/matir/files on "Workstation" to /tmp on "Server". I could either do:
Code:
Workstation# scp -r /home/matir/files Server:/tmp Code:
Server# scp -r Workstation:/home/matir/files /tmp |
Quote:
I was wondering though, is there any way to use SCP to copy from a remote host that you're already SSH'ed into and route the files to the box you're actually using? It seems to make sense that you could do it this way but I'm not sure. Thanks again, though. Awesome post! |
The pt is that ssh simply logs you in securely to any system, inc the 'current' one.
Once you are ssh'd into system B, that is your 'local' system for that shell; don't think of it as remote. Therefore the usual cmd applies ie scp /somedir/file user@remote:/somedir where remote is the system you want to put the files on. Note the remote can be any system, inc the same one you are running the cmd from. :) If you originally login to A and want files from B, then on A scp user@B:/dir/file . Also note that if 'remote' user is the same as 'current' user, then 'user@' is redundant eg from fred on A to fred on B scp file B:/dir and it'll ask for fred's passwd. See auth-keys for paswordless access eg automated processes. |
All times are GMT -5. The time now is 12:56 AM. |