Tinyssh
tinyssh.org
tinyssh.org
Apologies in advance for being a security curmudgeon, but I'll eat my hat if their homegrown crypto library doesn't have vulnerabilities. Crypto is hard, even for the best experts. The only way to get this right is with code that's had many eyes on it and has been battle tested.
Edit: my bad, TinySSH is using its home-grown version of NaCl, so parent's comment applies.
Sounds like you can use NaCI directly.
> TinySSH has its _own_ crypto library _compatible_ with NaCl, Libsodium...
TinySSH has its _own_ crypto library _compatible_ with NaCl: Libsodium
This isn't quite right. NaCl is a Daniel J. Bernstein project that predates Heartbleed by several years[0]. Though I'm sure Heartbleed generated new interest in better designed, more secure, crypto libraries.
Looks like tweetnacl split back up into the same files as the reference implementation.
There is an obvious error in this reply as well. NaCl was not "started by crypto experts in response to Heartbleed." NaCl was published in 2011 and the Heartbleed did not occur until 2014.
If NaCl, or even TweetNaCl, is "homegrown crypto" why are all these projects using it: https://ianix.com/pub/curve25519-deployment.html OpenSSH included.
How much does tinyssh's internal library differ from TweetNaCl's? Wouldn't a security curmudgeon at least examine those differences. If the user downloads NaCl from https://nacl.cr.yp.to first, tinyssh will use the external NaCl library not the "homegrown" internal library based on TweetNaCl. I never use the internal library.
Seems like a challenge to me!
This being auditable and significantly decreasing the attack vector surface area for ssh seems promising.
Still pretty impressive project. Would be fun to take a deeper look at it at some point.
This is what PHK did when designing Varnish (IIRC): instead of dealing with lots of files on its own (like Squid), just create some files and do a malloc() on them and let the OS do the work:
* https://varnish-cache.org/docs/trunk/phk/notes.html
One discussion (many others):
It's a beautifully powerful function :)
(Some allocators, like glibc may also use brk, but it's possible to write a fully functional allocator with only mmap).
They answer what it means and provide the command used to figure it out in the first FAQ: https://tinyssh.org/faq.html
$ wc
void main(int argc, char **argv) { printf("Hi, I'm %s\n", argv[0]); }
1 11 70
lines words chars
$ tr '()[]{}*+.>,";'"'"- ' ' | wc
void main(int argc, char **argv) { printf("Hi, I'm %s\n", argv[0]); }
1 13 70The latest scp clients use the sftp server, but older implementations will need both to be accessible.
I'm not familiar with additional approaches, and Teleport is a very different approach than tinyssh, focused on more features and controls than regular SSH. I imagine there are several other good options using the golang libs, or in theory someone could build their own limited implementation as an alternative.
And full disclosure, I work for Teleport, but my comments are my own.
That said, have you read an RSA implementation? It's not a lot of code.
https://www.reddit.com/r/sysadmin/comments/4gktbr/ssh_ed2551...
I particularly enjoyed this answer:
> ed25519 is more secure in practice. One of the biggest reasons to go with ed25519 is that it's immune to a lot of common side channels. While ed25519 is slightly less complex to crack in theory, in practice both of them are long enough that you're never going to be able to crack it, you need a flaw to exploit in the implementation or a substantial leap forward in cryptanalysis. ed25519 is more secure in practice because most instances of a break in any modern cryptosystem is a flaw in the implementation, ed25519 lowers the attack surface here.
https://www.libssh.org/2013/11/03/openssh-introduces-curve25...
"This algorithm does not rely on NIST-based curves and gives us more security confidence against a possible backdoor in nistp-256 curve. Today is a big day for us because OpenSSH team approved my patch and made curve25519-sha256@libssh.org the default key exchange!"
Also, the original RSA keys used in SSH have a sha-1 problem, and have been deprecated.
https://www.zdnet.com/article/openssh-to-deprecate-sha-1-log...
https://www.openssh.com/releasenotes.html
This release disables RSA signatures using the SHA-1 hash algorithm
by default. This change has been made as the SHA-1 hash algorithm is
cryptographically broken, and it is possible to create chosen-prefix
hash collisions for <USD$50K [1]
For most users, this change should be invisible and there is
no need to replace ssh-rsa keys. OpenSSH has supported RFC8332
RSA/SHA-256/512 signatures since release 7.2 and existing ssh-rsa keys
will automatically use the stronger algorithm where possible.
Incompatibility is more likely when connecting to older SSH
implementations that have not been upgraded or have not closely tracked
improvements in the SSH protocol.Furthermore:
> Also, the original RSA keys used in SSH have a sha-1 problem, and have been deprecated.
This is wrong. What's correct is that openssh plans to deprecate sha1 signatures, but you can still use your RSA keys with sha2-based signatures.
Kinda strange people are moving on to EC cipher - which is good, but to the cipher which has the NIST/NSA smell.
http://blog.cr.yp.to/20140323-ecdsa.html
"To be fair I should mention that there's one standard NIST curve using a nice prime, namely 2^521 - 1; but the sheer size of this prime makes it much slower than NIST P-256."
One thing to keep in mind is that SSH uses RSA only for signatures. That already kills off most attacks on RSA, as encryption has always been weaker than signatures. Not using a small exponent key kills the most significant attack on signatures.
Regarding sidechannels, the biggest issue I can think of is that ideally you should have constant time modular arithmetic, but you need that for ed25519 as well.
Not necessarily advocating for RSA (ed25519 is fine I guess), but I feel the "RSA is bad" talking point has been overused.
1) (minor) The command to use a different encryption method to the default one 2) (major) how to remember more than the first two characters of ed25519
When I feel serious about not using RSA, I literally google "ssh ed" and pray it will autofill the rest of it. If I am not there within 15 seconds of opening my browser I am rolling with RSA256.
I meant your personal identity key in ~/.ssh/id_*. The one that you might have on a bunch of servers, or give to github, or whatever. It's a good practice to periodically regenerate those, but I don't think it happens quite as often.
Exactly what I avoid. Each of them gets their own separate key. Never the same key to a bunch of machines (except maybe transient VMs).
But I agree, if a server changes its SSH implementation to one that does not support your existing key, it's a hassle, to say the least. In reasonable circumstances this does not happen without a plenty of warning well ahead of time, to allow you to regenerate your key in a new format.
TinySSH is a small SSH server using NaCl, TweetNaCl - https://news.ycombinator.com/item?id=7727738 - May 2014 (61 comments)
That said, I greatly appreciate this kind of effort, and I will probably even look into using it for small embedded projects in the future. My pessimism about security track records does not block out my optimism that we can and should do better, and this sounds much better than some other alternatives.
I have to support an Oracle 10g database on this platform, and I run tinyssh on port 26:
$ ssh -p 26 myserver.com
$ cat /etc/redhat-release /etc/oracle-release
Red Hat Enterprise Linux Server release 5.11 (Tikanga)
Oracle Linux Server release 5.11
$ ps -e -o user,pid:5,args | grep tinyssh
root 14147 tinysshd -lpsv -x sftp=/usr/libexec/openssh/sftp-server /etc/tinyssh/sshkeydir
$ size /usr/sbin/tinysshd
text data bss dec hex filename
122828 1428 680156 804412 c463c /usr/sbin/tinysshd
Unfortunately, I can't get it running on HP-UX 10.20, but I only have one of those left.Also, logins on the root account cannot be disabled, although /etc/profile could also be used to shut that down.
[Edit] I got downvoted, for some reason. It's a simple question - the article says it uses certain systemd components. I'm just asking if it can be used without systemd.
Are there any jurisdictions which doesn't recognize public domains?
I wish it was dual-licensed as MIT.
Are there any other smaller SSH clients out there?
TinySSH is a project which ships an alternative to sshd which binary is named tinysshd.
I'm just pointing out that project names need not reflect the names of the binaries shipped by that project. Heck, the project named Apache made its name by shipping a binary called httpd.