News for hackers. Stuff that matters.
Re:Deprecating scp by edwintorok on Friday November 06, 2020 @04:45AM (#25006409)
IIUC the `scp` cmdline will still exist it'll just use the sftp protocol behind the scenes instead of the eco protocol. Note that the deprecation is about the protocol not the cli.
Re:Deprecating scp by DarkmSparks on Friday November 06, 2020 @07:37AM (#25007181)
I doubt this will be accepted.

It'll break a lot of valid functionality that relies on it, and the only case I can see presented as to why is for situations when servers choose to offer scp when they should have chosen to offer sftp.

Complaining that some people hand out shell access and this creates a "problem" that they gave people access to shell commands verges on ridiculous.

Re:Deprecating scp by hannob on Friday November 06, 2020 @08:51AM (#25007567)
It looks like the openssh main dev is positive about this change: https://github.com/openssh/openssh-portable/pull/194#pullreq...

That sounds like it will probably be accepted after a few more minor fixes.

Re:Deprecating scp by eneveu on Friday November 06, 2020 @04:16PM (#25011256)
Having servers offer scp instead of ssh is not the only problem.

What about this part of the article:

Finally, while the danger is remote, it is worth noting that a local file name containing `backticks` (a file named `touch you-lose`, for example) will be handled the same way on the other end; if a user can be convinced to perform a recursive copy of a directory tree containing a file with a malicious name, bad things can happen.

Re:Deprecating scp by TheRealPomax on Friday November 06, 2020 @11:39AM (#25008918)
You can deprecate something while still letting people add it back into their PPA manually. If you absolutely need an deprecated tool, no one's going to stop you: it's linux. Heck, just com,pile it from source and be on your merry unsupporteed way.
Re:Deprecating scp by monoideism on Saturday November 07, 2020 @06:49AM (#25014553)
Yeah, and lose the security updates?

I much prefer the status quo. Don't agree that this change is necessary.

Re:Deprecating scp by TheRealPomax on Sunday November 08, 2020 @10:37AM (#25026385)
The scp protocol is literally deprecated: what do you not agree with? The idea (and already being worked on) is to change the scp command's underlying code so that it behaves exactly the same as before, all your scripts will keep working just fine, it just won't use the now dead scp protocol under the hood and will instead use the universally supported sftp protocol.
Re:Deprecating scp by monoideism on Sunday November 08, 2020 @04:49PM (#25029401)
The replacement scp was described as not even being an official project of OpenSSH, so it's not being officially replaced.

Is that not correct?

And you don't deprecate a 25-year old utility with just a replacement "idea".

Re:Deprecating scp by craftinator on Friday November 06, 2020 @12:43PM (#25009472)
So... have you heard of wayland? If X11 can be deprecated without a drop-in replacement, then scp is pretty much doomed.
Re:Deprecating scp by fuzxi on Friday November 06, 2020 @04:43PM (#25011475)
X11 has not been deprecated. It is still actively developed. The most recent commit was 23 hours ago. [1]

[1]: https://cgit.freedesktop.org/xorg/lib/libX11

Re:Deprecating scp by StillBored on Friday November 06, 2020 @11:01AM (#25008571)
Which probably won't work in a lot of cases. I just got burned by the very minimal raspian ssh server they ship by default.

First it didn't support the authentication method I wanted to use, and then it didn't have any port forwarding ability. I'm betting it doesn't have sftp support either.

Re:Deprecating scp by neop1x on Sunday November 08, 2020 @06:09AM (#25024921)
Yes, many embedded devices run Dropbear where built-in scp support is often enabled. But most systems probably won't have sftp binary from openssh installed ( https://openwrt.org/docs/guide-user/services/nas/sftp.server )
Re:Deprecating scp by lloeki on Friday November 06, 2020 @09:51AM (#25007946)
In practice many times I end up using:

    ssh cat /foo/bar > /bar/baz 
    ssh tar c /foo | tar x -C /bar
mostly because variants such as vagrant ssh or docker-machine ssh, cross-product with the remote target being any weird platform like solaris or a limited busybox or has sftp disabled
Re:Deprecating scp by jcranmer on Friday November 06, 2020 @11:07AM (#25008621)
In practice, tar c | ssh tar x can actually be far faster than scp -r, especially when you have a lot of small files.
Re:Deprecating scp by sethhochberg on Friday November 06, 2020 @03:26PM (#25010796)
I've found many people either forget (or never knew) that pipes have a buffer, and that buffers are very useful when you are dealing with potentially bursty throughput.

In a previous team where we dealt with shipping around lots of ZFS snapshots (where both the performance of reading from disk can vary based on the ARC and filesystem metadata) and occasionally using VPN tunnels on public internet links, pv to get even larger pipe buffers than standard was often a huge performance equalizer. Readers read as fast as they can, writers write as fast as they can, and the buffer massages any variability in the middle.

https://linux.die.net/man/1/pv

Re:Deprecating scp by saltcured on Friday November 06, 2020 @04:07PM (#25011160)
It's not just the buffer, it is the PIPE. Specifically, pipelining that streams one file after another, without an idle period of waiting for the round-trip acknowledgements of one file receipt prior to sending the next. Using rsync over ssh has the same massive benefit for transferring many files, even if there is no existing data to make use of its differential transfer mechanisms.

(Those extra mechanisms are usually beneficial in WAN scenarios as well, except when you have high speed links, in which case blasting the full files may be faster than doing the IO to figure out comparisons and skip transfer.)

Edited: adjusted confused punctuation.

Re:Deprecating scp by edgyquant on Friday November 06, 2020 @01:16PM (#25009811)
I’ve also used

   dd if=filename | ssh hostname dd of=remote_filename
Quite a bit
Re:Deprecating scp by jrumbut on Friday November 06, 2020 @02:53PM (#25010562)
There's something a little badass about using dd to transfer a file to a remote system.
Re:Deprecating scp by asveikau on Friday November 06, 2020 @11:57PM (#25013301)
I was transferring files to an Android device, and adb push wasn't working for some reason. It would hit an error and kill the adb connection until I re-plugged the USB.

Somehow this worked:

    dd if=foo | adb shell dd of=/storage/.../foo
Re:Deprecating scp by schoen on Friday November 06, 2020 @03:21PM (#25010770)
Everything is a file!
Re:Deprecating scp by lloeki on Friday November 06, 2020 @04:28PM (#25011358)
Ah yes, that one too. Used it a couple of times straight with a /dev/sda to best effort salvage data from a broken but running remote system I knew would not reboot as is.
Re:Deprecating scp by a1369209993 on Friday November 06, 2020 @03:29PM (#25010830)
Huh, pleasantly surprised to learn that dd correctly handles the truncated final block of a not-multiple-of-512-byte file; could have sworn that didn't work at some point.
Re:Deprecating scp by dfox on Saturday November 07, 2020 @03:53AM (#25013912)
SUS specifies that dd should do the "right thing" with input with non-integer number of blocks input, that is pad it with zeros if conv=sync, just pass through shorter otherwise.
Re:Deprecating scp by a1369209993 on Saturday November 07, 2020 @12:36PM (#25016627)
> SUS specifies that dd should do the "right thing"

A example the C standard could stand to learn from, then.

Re:Deprecating scp by drran on Saturday November 07, 2020 @04:36AM (#25014083)
Why not just

  cat file | ssh user@host 'cat >file'
  ssh user@host cat file | cat >file
?

PS.

I use mc to copy: F5, Enter.

Re:Deprecating scp by edgyquant on Sunday November 08, 2020 @09:23PM (#25030842)
Cause when I younger I didn’t know how to pipe like that and dd just worked. It’s kinda stuck with me and there isn’t much a different imo
Re:Deprecating scp by herodoturtle on Friday November 06, 2020 @05:29AM (#25006588)
Thanks for clarifying. I felt the same as OP above. The title of this post totally through me off.
[dead]
Re:Deprecating scp by alias_neo on Friday November 06, 2020 @08:14AM (#25007362)
In my, and possibly their defence, I read the article, and missed the one line in the second to last paragraph which states that it is the protocol being replaced. The way the article opens, coupled with the title makes that an easy point to miss.
Re:Deprecating scp by hinkley on Friday November 06, 2020 @11:13AM (#25008683)
Burying the lede. We are all bad at it, but developers seem to be worse than most.

Maybe it’s all the bottom up thinking we do.

Re:Deprecating scp by kstrauser on Friday November 06, 2020 @12:43PM (#25009467)
I've become a big fan of military-style Bottom Line Up Front writing[0]. In this case, the article could have started with "we're deprecating the scp protocol and updating the scp command line utility to use the sftp protocol instead."

[0] https://www.animalz.co/blog/bottom-line-up-front/

Re:Deprecating scp by stjohnswarts on Friday November 06, 2020 @09:55AM (#25007988)
Yeah it seems like that would be in the first paragraph.
Re:Deprecating scp by LeCow on Friday November 06, 2020 @05:51AM (#25006668)
> OP: ask innocent question to clarify the article

> You: understand the article better!

Re:Deprecating scp by daniellarusso on Friday November 06, 2020 @06:19AM (#25006811)
To confirm if headlines are accurate?
Re:Deprecating scp by Aeolun on Friday November 06, 2020 @06:41AM (#25006920)
Pretty solid plan generally speaking I think.
Re:Deprecating scp by dathinab on Friday November 06, 2020 @11:48AM (#25008999)
Scp itself is/will be deprecated.

(But not deleted for now)

A new command with similar cli but different name is in process but it will not (and can't) support all features of scp so it can't be a drop in replacement and as such you can't name it scp as this would brake existing systems.

Re:Deprecating scp by jhenkens on Friday November 06, 2020 @11:59AM (#25009085)
I forsee a new alias in my .bashrc
Re:Deprecating scp by alias_neo on Friday November 06, 2020 @08:10AM (#25007332)
Thanks for pointing that out, even after reading the article I had not understood that to be the case. I suspect doing so will have issues of its own however.
Re:Deprecating scp by blisterpeanuts on Friday November 06, 2020 @08:12AM (#25007347)
I agree; the headline simply says "deprecating scp" which suggests that the command "scp" would be deprecated :)