Skip to content

scp between two different hosts

Every now and then I try to scp files between two hosts with just one command. But it mysteriously fails with:
$ scp bob@saturn:/tmp/foo alice@pluto:/tmp/bar
bob@saturn's password: 
Permission denied, please try again.
But the password for bob@saturn is definitely right (I promise!), so what's going on here? Let's take a closer look:
$ scp bob@saturn:/tmp/foo alice@pluto:/tmp/bar
bob@saturn's password: 
$ ps -ef | grep [s]cp
[...] scp bob@saturn:/tmp/foo alice@pluto:/tmp/bar
[...] /usr/bin/ssh -x -oClearAllForwardings yes -n -l bob saturn \
       scp /tmp/foo alice@pluto:/tmp/bar
Now we see that scp(1) was actually executed on the saturn. The Permission denied was already pluto's response to the connection attempt. After stumbling over this issue a few times I finally found a nice explanation describing all this.


No Trackbacks


Display comments as Linear | Threaded

No comments

Add Comment

E-Mail addresses will not be displayed and will only be used for E-Mail notifications.
Form options

Submitted comments will be subject to moderation before being displayed.