sftp Vs scp

Ben Lindstrom mouring at offwriting.org
Fri Jan 25 05:27:30 AEDT 2019

Corinna Vinschen wrote on 1/24/19 6:28 AM:
> What's missing in sftp is a drop in replacement mode for copying to
> the remote server, i.e. this should work out of the box:
>    $ sftp -rp local_dir server:path
> But, alas:
>    ssh: Could not resolve hostname local_dir: Name or service not known
> If sftp had this mode, I would alias scp=sftp and be done with it.
If memory serves the argument was "if we are calling it an ftp client 
then it should act like an ftp client."  And sadly most ftp clients 
don't provide a command-line push UI which is why I abandoned my patch.

I know Damien Miller about a year or so later asked if I had the patch 
still, but by that point I had already left the project due to time 
constrains and deleted all my local code.  So maybe if presented again 
with something more "ftpish" it could be accepted:

sftp -rp -U /path/to/transfer  [user@]server:path


-U    upload a local file or directory (if -r is used) to the remotely 
server and path.

Damien, Darren?  Does that seem like a reasonable thing that may be 
accepted upstream for sftp?

I know it isn't a "UI replacement" but it at least provides a more 
complete UI for phasing people off of scp.


More information about the openssh-unix-dev mailing list