Call for testing: OpenSSH 8.0
lists.mindrot.org
lists.mindrot.org
> This release contains mitigation for a weakness in the scp(1) tool and protocol (CVE-2019-6111) [...] The scp protocol is outdated, inflexible and not readily fixed. We recommend the use of more modern protocols like sftp and rsync for file transfer instead.
I think it's the time to "alias scp=sftp". If the developers officially believe that scp should be retired, let's do the switch. Both are parts of OpenSSH and the commandline argument is almost identical.
Also, it has
> ssh(1), sshd(8): Add experimental quantum-computing resistant key exchange method, based on a combination of Streamlined NTRU Prime 4591^761 and X25519.
This is big. Together with XMSS signature, it means we already have a complete suite of post-quantum cryptography (experimentally) deployed in OpenSSH! It may be the first mass deployment of post-quantum cryptography in a major protocol.
One month ago, I commented that the introduction of XMSS post-quantum signature as "useless" (https://news.ycombinator.com/item?id=19160739), as the decryption of key exchange is much more vulnerable than spoofing the signature. But now NTRU+X25519 is deployed, great progress here!
* scp(1): Relating to the above changes to scp(1); the scp protocol
relies on the remote shell for wildcard expansion, so there is no
infallible way for the client's wildcard matching to perfectly
reflect the server's. If there is a difference between client and
server wildcard expansion, the client may refuse files from the
server. For this reason, we have provided a new "-T" flag to scp
that disables these client-side checks at the risk of
reintroducing the attack described above.
You could just do a remote `ls` and then `sftp` all the files listed to your client - nothing stopping a malicious return from `ls`? Surely it's the risk of running any kind of wild card copy? If the server is compromised then there's no telling what will be returned from such a command? The scp protocol is outdated, inflexible and not readily fixed. We
recommend the use of more modern protocols like sftp and rsync for
file transfer instead.
The protocol itself might be outdated, but surely one of the best aspects of `scp` comes from its simplicity [2]?[1] https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-6111
[2] https://github.com/openssh/openssh-portable/blob/master/scp....
Yes, we all know about xkcd, no need to link guys.
927 - Standards - https://xkcd.com/927/
1127 - Workflow - https://xkcd.com/1172/
1323 - Protocol - https://xkcd.com/1323/
In practice, this means that the OpenSSH implementation is the de facto standard, and that interoperating a non-OpenSSH client with a non-OpenSSH server is a gamble.
It's interesting that they push for sftp. Personally, if scp is vulnerable to certain types of attacks, I'd rather see an entirely new standard and an effort to avoid having it in draft state for decades.
I'm not sure why we need to see an entirely new standard, sftp as implemented by openssh is well conceived, simple, and covers its use case very well.
The key to my point here is "as implemented by openssh".
A relevant anecdote: I had to connect from my program to a third party (version 3) SFTP service, IIRC backed by some Oracle software (but don't quote me on that). I had a version 3 client library. The OpenSSH client worked just fine with the remote, and the client library worked just fine with an OpenSSH server. When connecting to the third party, the client gave up.
After some debugging I learned that the third party server didn't include the language tag in its response statuses (as SFTP version 3 software should). OpenSSH was just fine with this and ignored the problem, and the third party software was probably only ever tested with OpenSSH based clients.
It was definitely a bug in the third party service as far as I was concerned, but I think that this is the natural result of relying on behavior "as implemented by ssh" rather than a stable, well defined (and non-expired) standard.
alias scp="rsync --partial --progress --rsh=ssh"
You should keep in mind that it is rsync in the background, because parameter are different.
However, I expect plenty of people to be in the same case.
scp wins on brevity of commandline syntax
Would be nice to be able to just type sftp user@domain:/file and have it do the right thing.
Also rsync does not exist on windows, for instance git bash has only scp AFAIK.
https://docs.microsoft.com/en-us/previous-versions/windows/d...
Rsync's ssh support is generally good, so might be about equivalent, but it's not always handy.
1: https://www.cyberciti.biz/faq/howto-use-tar-command-through-...
A simpler invocation could run it through (unencrypted) inetd/socket activation.
SELINUX really throws fits of hysteria when running this, however.
$ cat sftp-tls.sh
#!/bin/sh
exec nc --ssl server 52345
$ sftp -S ./sftp-tls.sh bogus
Connected to bogus.
sftp> cd /nobody
sftp> get sftp-tls
Fetching /nobody/sftp-tls to sftp-tls
/nobody/sftp-tls 100% 15 8.9KB/s 00:00
sftp> quit
# cat /etc/stunnel/sftp-ssl.conf
#GLOBAL####
;sslVersion = TLSv1.2
TIMEOUTidle = 6000
renegotiation = no
FIPS = no
options = NO_SSLv2
options = NO_SSLv3
options = SINGLE_DH_USE
options = SINGLE_ECDH_USE
options = CIPHER_SERVER_PREFERENCE
syslog = yes
debug = debug
setuid = nobody
setgid = nobody
# chroot = /var/empty/stunnel
libwrap = no
service = sftp-ssl
; cd /var/empty; mkdir -p stunnel/etc; cd stunnel/etc;
; echo 'sftp-ssl: ALL EXCEPT localhost' >> hosts.deny;
; chcon -t stunnel_etc_t hosts.deny
; https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
ciphers=ECDH+AESGCM:ECDH+CHACHA20:DH+AESGCM:RSA+AESGCM:!aNULL:!MD5:!DSS
curve = secp521r1
#CREDENTIALS####
# verify = 4
cert = /etc/stunnel/sftp-ssl.pem
#ROLE####
exec = /usr/libexec/openssh/sftp-server
# execargs= sftp-server -d /home/nobody
# execargs= sftp-server -l DEBUG3May I suggest using rsync instead? The syntax is much closer to scp than sftp is, to the point of being compatible for the most trivial use cases. But rsync is actively developed and has much saner defaults, can continue broken transfers etc.
I have stopped using scp and sftp many years ago. Besides the fact that sftp can be too slow, both scp and sftp fail to make identical copies of the transferred files because sometimes they can lose some metadata, e.g. extended attributes or high resolution time stamps.
alias scp='rsync --archive --xattrs --acls --progress --rsh="ssh"'
ssh remote 'cd /src;tar -cf - .' | (cd /dst;tar -xf -)
Doesn't call you out so well on typos though.eg, instead of one connection (eg rsync), lftp can transfer each file using n parallel streams.
Very useful with large files, when there's some kind of bandwidth limit per TCP connection.
[ edit ] if that and cygwin are too heavy, you could request the samba team create a posix windows build of rsync. They had one long ago, but stopped supporting it. That would be a single binary. I suspect they will push back.
I found a Github repo with an older (2017) version of cwRsync that may be from before it went behind a paywall @ https://github.com/billyc/cwrsync-installer
You can run a local console and rsync directly from your window drives (/drives)
https://docs.microsoft.com/en-us/windows-server/administrati...
https://heejune.me/2018/08/02/setup-rsync-server-over-ssh-on...
sftp -o IdentityFile=keyfile or scp -i keyfile
I've never used sftp before. Does it offer equivalents to:
scp server:'*.pdf' .
or scp server:'*(oc[1])' .
for getting the last created file with zsh extended globs, or scp server:'$(custom_remote_program)' .
where custom_remote_program is shell code that outputs a list of files using server-side state?EDIT: Reading:
> * scp(1): Relating to the above changes to scp(1); the scp protocol relies on the remote shell for wildcard expansion, so there is no infallible way for the client's wildcard matching to perfectly reflect the server's. If there is a difference between client and server wildcard expansion, the client may refuse files from the server. For this reason, we have provided a new "-T" flag to scp that disables these client-side checks at the risk of reintroducing the attack described above.
I guess, I'll actually want:
alias scp='scp -T'
or just use `-T` on a need by basis. I admit I don't need that feature every week, but it is a relief that they didn't remove the functionality outright. I think the closest equivalent is something like: ssh server 'tar c $(custom_remote_program)' | tar xC destination
which I'd rather not be writing.I also find the --include --exclude behaviour very confusing. does --include=* outweigh --exclude=thing and vice-versa and does this reset left to right?
Any file copying program which is unable to make identical copies is garbage in my opinion.
The Linux tmpfs file system is another bad example. Like scp, which can silently lose information, copying a file to a tmpfs directory, then again to a decent file system can lose file metadata.
I hope so!
OpenSSH is a critical piece of infrastructure in most unix and linux environments, so making sure external contributors do some extra diligence seems like a good thing!
Asking contributors to learn CVS as a quality gate is like having a tech interview process that requires beating the hiring manager at chess. Sure, you're looking for smart people, and sure, people good at chess are usually smart, but the correlation is so low you'll lose out on good candidates and get candidates who are better at chess than coding.
There is a git mirror on github and you can work on that and submit diffs to the mailing list if you’re worried about having to read the cvs manpage ;)
They just choose not to, for (as I understand it) a combination of reasons. Being averse to relying on new GPL code, being "happy enough" with CVS (also working on OpenCVS), and CVS being a little more than just source control for them due to the likes of CVSync[1].
I have patches in Git. If OpenBSD doesn't want to use it that's fine by me, and I wish them the best of luck. But let's be clear, it's not because we're telling them they can't use it.
I think he means he is a contributor to the source of `git` itself, and thus is justified in saying "we" in terms of not prohibiting OpenBSD's contributors from using the software he helps develop (git).
Are they really though? I can't remember for how long "OpenCVS is to be released soon"[1] but the page itself begins the copyright in 2004.
While I respect other technical decisions taken by the OpenBSD team this one strikes me as pure hubris. Sticking to SVN I could sort-of understand but CVS is just ridiculously frustrating to work with.
[1] https://web.archive.org/web/20050130011942/https://www.openb...
Not actively. It has been in hybernation for a long time.
Not counting the recently-ish fixes I committed not much is happening with it.
It would certainly be easier for external contributors (and us) if OpenBSD used git natively but as OpenBSD was AFAIK the first open source project to expose a CVS tree of their work to the world there's a lot of legacy to overcome.
FIDO tokens only want to do two things: Provide you with a cookie and a public key, then later as often as necessary take a cookie and give you proof they still know the associated private key. Very narrowly conceived, on purpose.
SSH public key auth has the client start by proposing "OK, I can prove I know key X" and then the server either says "Fine, do that then" or "No, what else do you have?". An out of box OpenSSH server decides which to do by examining the ~/.ssh/authorized_keys file. A FIDO token needs the _server_ to begin by saying "OK, here's a cookie, can you prove you know the corresponding private key?" so that it can get the cookie, otherwise it can't prove anything.
Disclaimer: I'm one of the contributors.
So to help everyone (read whole post first), you should probably have the line
KexAlgorithms sntrup4591761x25519-sha512@tinyssh.org,curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256
in /etc/ssh/sshd_config of server and /etc/ssh/ssh_config of client (under "Host ").
(The rest of the kex recommendations are from https://stribika.github.io/2015/01/04/secure-secure-shell.ht...)
---
However, for some reason after running "/usr/sbin/sshd -T" it said
"/etc/ssh/sshd_config line 2: Bad SSH2 KexAlgorithms 'sntrup4591761x25519-sha512@tinyssh.org'."
so I played around. It's hard for me to go back on everything I tried but a working solution seemed to be to add the
KexAlgorithms sntrup4591761x25519-sha512@tinyssh.org,curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256
line to server's "/usr/local/etc/sshd_config" and to client's "/usr/local/etc/ssh_config" under "Host ".
You then need to start the server by running "sudo /usr/local/sbin/sshd" and you need to use the ssh client with the binary "/usr/local/bin/ssh".
On a side note, I lost the list of applications that are not conforming to it. I know there are a couple, and would be glad if you were to share the ones you know about.
>OpenSSH (and it's ancestor ssh-1.x) have a 17 year history of using ~/.ssh. This location is baked into innumerable users' brains, millions of happily working configurations and countless tools.
XDG can be considered as a case of arbitrary change for weak justification. SSH is definitely a case where people need to know exactly where the configuration is. There is no point in including it in the not very fun "find the config files" game engendered by XDG.
However, an issue I have is that while you can configure that path system-wide, there is no way to control it per-user, or with a finer-gained approach. You can probably use mount namespaces to shadow a ~/.ssh with another config, but that seems overkill.
I admit I have no practical use cases for this right now (though I probably did in the past) besides "uncluttering $HOME". As for hunting the config files, those would reside in ~/.config/ssh by default. I personally find it more irritating when a program picks a random folder instead of conforming to the spec (and if I set the environment variable to somewhere else, I then know where it is). Go hunt trough ~/{.program,.program/conf,Program/conf,Documents/Program/conf,Documents/My\ Games/conf}, or countless variants I experienced. Thought it is admittedly a much smaller problem with better-established programs such as openssh.
I hope this one doesn't continue this worrying tendency.
If your clients are broken, they should be updated.
There is no problem using aes128-ctr as far as I know.
Finally, diffie-hellman-group14-sha1 is not ideal, but breaking sha1 requires vast resources.
An sshd allowing these settings can talk to very, very old versions, and the CPU usage of these is light compared to some of the more modern configurations.
I do have systems that are sensitive to CPU usage, and I retain these settings there, where I am less concerned about ultimate protocol security, and more focused on performance and a light footprint.