View previous topic :: View next topic |
Author |
Message |
saski4711 Apprentice
Joined: 24 Jun 2004 Posts: 199
|
Posted: Sun Jul 26, 2020 6:48 am Post subject: scp removed? |
|
|
Hello,
I've noticed that scp is no longer availble on my system. Has it been removed or replaced with recent package updates or is it just me?
Stuck by Neddyseagoon.
Its bound to cause a bit of an upset when users discover that scp is gone by default. |
|
Back to top |
|
|
fedeliallalinea Administrator
Joined: 08 Mar 2003 Posts: 31255 Location: here
|
Posted: Sun Jul 26, 2020 7:01 am Post subject: |
|
|
You can active it with scp use flag see https://bugs.gentoo.org/733802 _________________ Questions are guaranteed in life; Answers aren't. |
|
Back to top |
|
|
Ionen Developer
Joined: 06 Dec 2018 Posts: 2837
|
Posted: Sun Jul 26, 2020 7:24 am Post subject: |
|
|
There's talk on gentoo-dev to put add some form of warning/news about this but those on ~testing may get the surprise if not paying attention to new USE flags meanwhile (hasn't reached stable yet).
Given upstream has no intention to fix this not to break scp's normal functionality, a opt-in USE=scp for awareness seem like a reasonable solution. |
|
Back to top |
|
|
saski4711 Apprentice
Joined: 24 Jun 2004 Posts: 199
|
Posted: Sun Jul 26, 2020 8:01 am Post subject: |
|
|
Thank you for the scoop. scp is back on my system! |
|
Back to top |
|
|
fedeliallalinea Administrator
Joined: 08 Mar 2003 Posts: 31255 Location: here
|
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54573 Location: 56N 3W
|
Posted: Sun Jul 26, 2020 10:46 am Post subject: |
|
|
scp has gone from testing by default and upstream want to phase it out.
Its only a matter of time until its dropped.
The writing is on the wall. Its time to find something else, like rsync over ssh. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
Ant P. Watchman
Joined: 18 Apr 2009 Posts: 6920
|
Posted: Sun Jul 26, 2020 10:49 am Post subject: |
|
|
sftp still works fine. net-fs/sshfs uses it, if you're too lazy to learn the syntax. |
|
Back to top |
|
|
cboldt Veteran
Joined: 24 Aug 2005 Posts: 1046
|
Posted: Sun Jul 26, 2020 12:19 pm Post subject: |
|
|
sftp appears to use the same syntax as scp - at least it works the same here for the occasional one or few file transfers.
For those wondering where the USE flag applies, scp and sftp are both provided by net-misc/openssh |
|
Back to top |
|
|
Ionen Developer
Joined: 06 Dec 2018 Posts: 2837
|
Posted: Sun Jul 26, 2020 12:22 pm Post subject: |
|
|
^ same'ish syntax only works for downloads as far as I know, for uploads you'd need a wrapper to mimic basic scp.
Generally I do prefer to just use sshfs when I have it setup though, I even use it to read/transfer files from windows boxes running sshd/sftp (similar software exists for the other way around but I haven't tried it).
Edit: pscp (from putty) mentioned in the bug does seem to mimic scp pretty well if need be |
|
Back to top |
|
|
Ionen Developer
Joined: 06 Dec 2018 Posts: 2837
|
|
Back to top |
|
|
pjp Administrator
Joined: 16 Apr 2002 Posts: 20476
|
Posted: Tue Jul 28, 2020 6:32 am Post subject: |
|
|
Maybe...
Quote: | I tried to put together something that now works and passes the scp
testsuite (with both scp and sftp modes):
https://github.com/openssh/openssh-portable/pull/194
What does not work is the extended remote-to-remote through local,
which would require some more low-level protocol tweaks.
Most of the code is taken and adapted from the sftp.c . There are still
a few TODOs, but lets take it as a first iteration/proof of concept. | https://marc.info/?l=openssh-unix-dev&m=159481501428508&w=4 _________________ Quis separabit? Quo animo? |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54573 Location: 56N 3W
|
Posted: Tue Jul 28, 2020 7:40 am Post subject: |
|
|
Don't count on scp staying.
Upstream don't like scp and I suspect IUSE=scp is only back long enough to get the publicity out.
Lennart Poettering wrote: | Gentoo folks, this is your wakeup call. |
I knew that quote would be useful one day :) _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
halcon l33t
Joined: 15 Dec 2019 Posts: 649
|
Posted: Tue Jul 28, 2020 1:38 pm Post subject: |
|
|
Please correct me if my thought process is wrong.
From Bugzilla:
Not having scp installed does nothing to alleviate the vulnerability.
From Write up for CVE id CVE-2020-15778:
Exploit scenarios.
Scenarios where ssh is blocked for user but scp allowed by command option in authorized_keys file. You can bypass this restriction and execute command on remote server.
SCP supports directory transfer with " -r " option. As linux allows backtick (`) in file name. attacker can create a payload in file name and when a victim is coping complete folder to remote server, payload in the file name will execute.
=>
So, exploiting this vulnerability becomes possible if:
(1) SCP program is installed on the attacker's computer (not necessarily victim's one), as it can evaluate backticks
and
(2) SCP is allowed in authorized_keys file on the victim's computer
?
EDIT: And a question after: does the USE flag -scp for ssh disable "allowing" scp via authorized_keys file? Or is it better to disallow backticks in filenames for ssh?
Last edited by halcon on Tue Jul 28, 2020 3:24 pm; edited 2 times in total |
|
Back to top |
|
|
Anon-E-moose Watchman
Joined: 23 May 2008 Posts: 6145 Location: Dallas area
|
Posted: Tue Jul 28, 2020 2:22 pm Post subject: |
|
|
Next message in link
Code: | I have had this in my .bashrc for years:
alias scp='rsync -avzP' |
Which works for me, as I have rsyncd everywhere I copy to/from. _________________ PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland |
|
Back to top |
|
|
pjp Administrator
Joined: 16 Apr 2002 Posts: 20476
|
Posted: Tue Jul 28, 2020 3:37 pm Post subject: |
|
|
rsync isn't a solution for me. I've lost data from its misuse. I have not had that problem with scp. sftp does not appear to be a functional replacement, although that may be my lack of understanding how it should be used. The only solution I found was to use a here doc. _________________ Quis separabit? Quo animo? |
|
Back to top |
|
|
Anon-E-moose Watchman
Joined: 23 May 2008 Posts: 6145 Location: Dallas area
|
Posted: Tue Jul 28, 2020 3:55 pm Post subject: |
|
|
Even if openssh were to remove scp from the tarball, I'm pretty sure someone will pull out the relevant parts to create an scp, it just won't be worked on by openssh upstream and whoever uses it needs to be aware it's not that secure.
Edit to add: even looking at the latest ebuild, scp gets built, whether the scp flag is set or not
Code: | # https://bugs.gentoo.org/733802
if ! use scp; then
rm "${ED}"/usr/{bin/scp,share/man/man1/scp.1} \
|| die "failed to remove scp"
fi |
_________________ PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland |
|
Back to top |
|
|
pjp Administrator
Joined: 16 Apr 2002 Posts: 20476
|
Posted: Tue Jul 28, 2020 4:51 pm Post subject: |
|
|
That is partly why I referenced the mailing list post. The author has an RH email address, so there might be some backing to have an sftp based scp. _________________ Quis separabit? Quo animo? |
|
Back to top |
|
|
|