scp: a funny error

penguin_compscp comes with the openssh package and uses ssh to copy files. I find a particular error of scp very amusing. Suppose I am trying to copy a file, myNotes.txt, from my local directory to a remote machine and I ran the following command:

$ scp mynotes.txt root@192.168.0.2:/home/apj/
ssh: connect to host 192.168.0.2 port 22: Connection refused
lost connection

You can see that I have typed the local file name wrong and scp will error out in the end because it won’t be able to find the file locally. I have the destination system’s port 22 blocked but had it been open scp would have actually opened a connection (and it could even be the other end of the globe ;)) only to find in the end that the local file is nonexistent! What a pity!

Comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s