scp removed?
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.
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.
- fedeliallalinea
- Administrator

- Posts: 31976
- Joined: Sat Mar 08, 2003 11:15 pm
- Location: here
- Contact:
You can active it with scp use flag see https://bugs.gentoo.org/733802
Questions are guaranteed in life; Answers aren't.
"Those who would give up essential liberty to purchase a little temporary safety,
deserve neither liberty nor safety."
- Ben Franklin
https://www.news.admin.ch/it/nsb?id=103968
"Those who would give up essential liberty to purchase a little temporary safety,
deserve neither liberty nor safety."
- Ben Franklin
https://www.news.admin.ch/it/nsb?id=103968
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.
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.
- fedeliallalinea
- Administrator

- Posts: 31976
- Joined: Sat Mar 08, 2003 11:15 pm
- Location: here
- Contact:
For info https://archives.gentoo.org/gentoo-dev/ ... 7d0679b8a6Ionen wrote:There's talk on gentoo-dev to put add some form of warning/news about this but those
Questions are guaranteed in life; Answers aren't.
"Those who would give up essential liberty to purchase a little temporary safety,
deserve neither liberty nor safety."
- Ben Franklin
https://www.news.admin.ch/it/nsb?id=103968
"Those who would give up essential liberty to purchase a little temporary safety,
deserve neither liberty nor safety."
- Ben Franklin
https://www.news.admin.ch/it/nsb?id=103968
- NeddySeagoon
- Administrator

- Posts: 56071
- Joined: Sat Jul 05, 2003 9:37 am
- Location: 56N 3W
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.
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.
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
^ 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
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
Maybe...
https://marc.info/?l=openssh-unix-dev&m ... 428508&w=4I 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.
Quis separabit? Quo animo?
- NeddySeagoon
- Administrator

- Posts: 56071
- Joined: Sat Jul 05, 2003 9:37 am
- Location: 56N 3W
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.
Upstream don't like scp and I suspect IUSE=scp is only back long enough to get the publicity out.
I knew that quote would be useful one day :)Lennart Poettering wrote:Gentoo folks, this is your wakeup call.
Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
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?
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.
- Anon-E-moose
- Watchman

- Posts: 6566
- Joined: Fri May 23, 2008 7:31 pm
- Location: Dallas area
Next message in linkpjp wrote:Maybe...
https://marc.info/?l=openssh-unix-dev&m ... 428508&w=4I 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.
Code: Select all
I have had this in my .bashrc for years:
alias scp='rsync -avzP'UM780 xtx, 6.18 zen kernel, gcc 15, openrc, wayland
minixforum m1-s1 max -- same software as above but used for ai learning
Zealots are gonna be zealots, just like haters are gonna be haters
minixforum m1-s1 max -- same software as above but used for ai learning
Zealots are gonna be zealots, just like haters are gonna be haters
- Anon-E-moose
- Watchman

- Posts: 6566
- Joined: Fri May 23, 2008 7:31 pm
- Location: Dallas area
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
Edit to add: even looking at the latest ebuild, scp gets built, whether the scp flag is set or not
Code: Select all
# https://bugs.gentoo.org/733802
if ! use scp; then
rm "${ED}"/usr/{bin/scp,share/man/man1/scp.1} \
|| die "failed to remove scp"
fiUM780 xtx, 6.18 zen kernel, gcc 15, openrc, wayland
minixforum m1-s1 max -- same software as above but used for ai learning
Zealots are gonna be zealots, just like haters are gonna be haters
minixforum m1-s1 max -- same software as above but used for ai learning
Zealots are gonna be zealots, just like haters are gonna be haters



