BUG: scp -r follows symlinks

Edward S. Peschko esp5 at pge.com
Tue Jan 6 11:55:41 EST 2004

hey all

'scp -r ' follows symlinks. IMO this is a bug and should be changed - it:

	a) hampers the use of scp. As it stands, I cannot use 'scp -r' because of this 
       behavior. If someone links to '/', or if I hit a recursive symlink, I'm screwed.

	b) It is inconsistant with cp. When you 'cp -r' on a file, it does NOT follow the 
	   symlink. When you scp -r on a file, you *do*.

	   And since scp is implemented in terms of cp (for local copies) this leads to 
	   one use of scp preserving links, and another by making files out of them! This 
	   is unintuitive and wrong.

Please change this if it already is not changed - or indicate that a patch could be 
accepted to change it. I am aware of the alternatives, such as tar and rsync. However,
using tar requires an extra binary to be installed on a remote or local machine, and rsync
requires an extra program to maintain, and an extra service to run(?). 

And I don't want an extra dependency just to shore up a deficiency in an otherwise useful


(ps - if people *don't* consider this a bug, then I'd appreciate someone telling me
why. Just from googling, I've seen people complain about this up and down, causing 
everything from GB of mistransfer to clogged traffic.


More information about the openssh-unix-dev mailing list