11 ms·
TinySSH is a small SSH server using NaCl, TweetNaCl
- itpcc 3y agoPoor, poor site. They got HN hug of death.
- deleted 3y ago[deleted]
- Brian_K_White 3y agoI can only assume it's idiots downvoting this, who think you are bashing the site instead of sympathising with it.
- seniorivn 3y agohttps://github.com/janmojzis/tinyssh https://github.com/janmojzis/tinyssh
- k8sToGo 3y agoWhat is the difference between this and dropbear ssh?
- themoonisachees 3y agoI don't think there's much of one. The concept in itself isn't really useful, I've never seen someone go "you know the real problem with sshd? It's too bloated". It is slightly useful to put in smaller devices that don't have much space but I think it still relies on top many linux facilities to be an appropriate fix for that too. Still, cool project.
- dhon_ 3y agoI suspect the average openssh-server user just uses it for remote terminal access and copying files. Reducing the attack surface by dropping features and outdated standards is certainly valuable.
- maxcoder4 3y agoDropbear ssh is very useful when you have a full disk encryption on a remote server and want to be able to decrypt it after a reboot.
- Nextgrid 3y agoThere's technically no reason OpenSSHd can't also be used in this context. Maybe 2 decades ago there was a legitimate performance/disk space reason which is why Dropbear was preferred for this use case (and the convention remains to do this day), but nowadays the couple megabytes of difference in your initrd between using Dropbear and OpenSSH won't matter.
- m45t3r 3y ago> There's technically no reason OpenSSHd can't also be used in this context. For initrd you generally prefer static binaries. Not saying that OpenSSHd doesn't build statically, but having less code and dependencies makes it easier to statically compile. But yes, technically there is no reason to not use OpenSSHd, but in practice having a smaller and more self contained binary helps considering that you would want the bare minimum during initrd.
- chasil 3y agoThis server is very restricted compared to dropbear. -passwords are not allowed, only keys -only a single AEAD cipher is supported, and a single elliptic curve for key exchange -root cannot be locked out with this server -the key restrictions available in OpenSSH are not supported -the server does not use dynamic memory, and has a better security record than dropbear
- bjoli 3y agoIt is smaller and supports less features. Dropbear does password auth and x11 agent forwarding iirc.
- Columbo818 3y agoDropbear claims to be RFC-compliant, but isnt. Proof here: https://www.cvedetails.com/cve/CVE-2021-36369/ https://www.cvedetails.com/cve/CVE-2021-36369/ TinySSH doesnt claim to be compliant, and isnt. Does less in exchange for a reduced attack surface.
- mkj 3y agoThat CVE is a UI confusion issue in the client, I'm not sure exactly what bit the reporter thought was non-RFC compliant.
- ThreeHopsAhead 3y agodropbear has the goal of being small and light on ressources while still providing featurefull ssh support. tinyssh is small because it only implements a tiny subset of SSH that is needed for secure basic SSH connections. It only includes few crypto primitives excluding even RSA. There is considerable overlap in the two and you can reach something similar to tinyssh by compiling dropbear with only few select features, but tinyssh aims to be as secure and attack surface minimized as possible out of the box. Another notable difference: > no dynamic memory allocation - TinySSH has all memory statically allocated (less than 1MB)
- underdeserver 3y ago[flagged]
- jddj 3y agoCan you justify this further in the context of this specific offering which appears not to manage dynamic memory?
- sylware 3y ago[flagged]
- latexr 3y agoIn this day and age, it’s probably best to understand that blindly suggesting something should be in Rust is indistinguishable from zealotry. Or from mockery of the people who do it.
- FergusArgyll 3y agoI feel like someone has to say this: What about LISP?!
- pquki4 3y agoThis kind of comment had become a joke these days, especially when you say that under a project written in C. Nobody is going to even think about that until Rust has as good portability as C.
- 3y ago
- CarRamrod 3y ago>easy auditable - TinySSH has less than 100000 words of code Is approximately one hundred thousand words really easily auditable?
- latexr 3y ago> approximately one hundred thousand words According to the index page, the current release is closer to half of that at 62989 words. Which is (allegedly, don’t trust the number too much) as long as 2001: A Space Odyssey. https://www.readinglength.com/book/isbn-0451452739 https://www.readinglength.com/book/isbn-0451452739 Not a long book, but in the context of code I wouldn’t consider that easily auditable.
- rthnbgrredf 3y agoWell, at least it fits into GPT-4 Turbo context. I think we are not far away from a fully automated audit that can at least check for 99% of common bugs and security issues.
- edf13 3y agoNot really, especially when they have: > TinySSH has its own crypto library
- tptacek 3y agoSeems like the wrong question. Rather: if it's easily auditable, who's audited it so far?
- loeg 3y agoI think they're both pretty reasonable questions!
- nemoniac 3y agoWhat is a "word of code"? I've seen "lines of code" but what's a "word" in C?
- teddyh 3y ago
- rand846633 3y agoCool project! There are many use cases where this is a good tool! Allways great to have another alternative to some other great tools.
- throw0101c 3y agoCurrently Slashdotted: * https://web.archive.org/web/20240324101238/https://tinyssh.org/ https://web.archive.org/web/20240324101238/https://tinyssh.o...
- sylware 3y agoI am pleased to see another "small"-is-beautifull alternative of a critical network protocol, and in plain in simple C (I am sorry for the fan boys of absurdely complex computer languages...). There will be plenty of compiler generated holes, and other security issues, but keep your head above the water and fix all of them, you are going for the long run there. We also have drop-bear, which is in between openssh and tinycc if I recall properly. I have to admit... I may deploy tinyssh for my everyday work (I rarely code directly on my workstation, usually I am "away" and do ssh to it via 4g internet IPv6/ssh). Now a bit of whining (come on, we are on HN), microsoft github is always a bad idea, should move to a fully noscript/basic (x)html friendly git repository (aka not gitlab based for instance, yet).
- pquki4 3y agoYou are fighting a losing battle if you don't want to see GitHub links on HN.
- serf 3y agoit's still worthwhile to point out the issues for people who have recently jumped into the occupation/hobby and haven't yet had the time to meditate on why Microsoft having the keys to the worlds' software kingdom might be A Very Bad THing down the line.
- jonathaneunice 3y agoIf neither GitHub nor GitLab, what are you recommending? There are a few other non-DIY hosted options, but it's hard for me to translate your "fully noscript/basic (x)html friendly" spec into an actionable list of options. Or is this a "host it yourself" / DIY plea?
- gkbrk 3y agoSoucehut works with noscript. No need to host or DIY anything. Codeberg has a message that says "This website requires JavaScript." but I was able to use it without JS to browse around and look at code properly.
- numpad0 3y agotinysshd doesn't implement unsafe features (such as password or hostbased authentication) Isn't password support useful for shared devices, like printers and routers? How would one enroll his personal keys on something like a car?
- bretthoerner 3y agotinyssh is great. One use case for it that people may not know about: using it during Linux boot so you can remotely unlock encrypted drives. I have a headless NAS server that uses dm-crypt/LUKS under ZFS. When I update my kernel/ZFS I remotely reboot the server, wait a few seconds, and then ssh into a tinyssh powered encryption key prompt to unlock the drives. (I am immediately booted from ssh, as tinyssh exits.) I can then ssh again a few seconds later and I'm hitting openssh on a fully booted machine that wasn't able to open the drives without my intervention. https://github.com/grazzolini/mkinitcpio-tinyssh https://github.com/grazzolini/mkinitcpio-tinyssh
- gymbeaux 3y agoUsually I use DropBear for this. Do you know if one is necessarily better than the other? DropBear I think is what RHEL docs recommend for remote boot disk decryption.
- bretthoerner 3y agoAh, I've never used DropBear. I don't know how one could be better than another for my simple use case, honestly.
- jethro_tell 3y agoI use normal opensshd for this. No reason to support two ssh daemons when you can do it with one. The difference in size on your init image is minimal and you probably aren't even trying to optimize for space there. If you don't know the size of your rd off the top of your head then it almost certainly doesn't matter.
- bretthoerner 3y agoAll fair, I guess I just landed on mkinitcpio-tinyssh first and it was my introduction to the idea, and only took a few seconds to setup. I'll switch to openssh if I ever have issues, but this has been working fine for many years, so I'm no rush.
- jvanderbot 3y agoThe license is "CC0 1.0 Universal" In light of this post outlining a bug in early CC licenses: https://doctorow.medium.com/a-bug-in-early-creative-commons-licenses-has-enabled-a-new-breed-of-superpredator-5f6360713299 https://doctorow.medium.com/a-bug-in-early-creative-commons-... Discussed here: https://news.ycombinator.com/item?id=39610509 https://news.ycombinator.com/item?id=39610509 Does this need updating? EDIT: based on some discussion, it does need updating, but not for the reason I thought. I filed a suggestion here: https://github.com/janmojzis/tinyssh/issues/85 https://github.com/janmojzis/tinyssh/issues/85
- gkbrk 3y agoIs that necessarily a bug? If you use Disney content without a license they won't give you a 30-day period to keep mis-using it. Same with using Oracle software. Why should people who create CC content provide such a grace period?
- jvanderbot 3y agoValidity of the post aside, there are real-world examples of this license being abused by third parties. Given the cost is very low to just change the license, I think it might be worth considering.
- skissane 3y agoTo be clear, the issue we are talking about here does not exist for the CC0 license TinySSH is using. CC0 lacks a termination clause, it wouldn't make sense for it to have one. It only exists for other CC licenses, like the (earlier versions of) CC-BY(-NC/-SA). CC0 has other issues – some people (e.g. Red Hat Legal) are concerned about its language explicitly excluding patent and trademark rights, and think that is legally inferior to other public domain declarations (such as The Unlicense) which don't mention that topic at all. In a declaration/license in which patents and trademarks go unmentioned, if the original author sues you on those grounds, you can try to argue that by releasing the software they gave you an implied patent/trademark license – that argument may or may not win in Court, but at least it has a chance. With language in the declaration/license explicitly excluding patents and trademarks (like CC0 has), that argument is likely dead-on-arrival.
- Hendrikto 3y agoShame that it does not support ed25519-sk. Apart from that, it looks very promising.
- yodon 3y agoIs NaCl still a thing? Genuine question as I've not heard it mentioned in years. [edit added] For those, like me, who thought this was using Google's NaCl (sandboxed C++), it's actually using Daniel Bernstein's NaCl (cryptography library).
- deleted 3y ago[deleted]
- deleted 3y ago[deleted]
- cchance 3y agoCool but something i saw that was weird, this may be the first repo i've ever seen to advertise ... words of code, i've always seen secure repos advertise their "in only X LOC" seeing words of code as a metric was funny
- creshal 3y agoIt's unusual, but IMO makes sense, as it encapsulates complexity better than LOC do, because the latter are more sensitive to formatting preferences etc. Books are also measured in words too (also for category thresholds, e.g. between a novella and a full novel), so there's precedent too.
- deleted 3y ago[deleted]
- oxryly1 3y agoMade it seem like it was written in Forth.
- fbdab103 3y agoThe Wren language[0] uses semicolons as its size metric: Wren is small. The VM implementation is under 4,000 semicolons. You can skim the whole thing in an afternoon. It’s small, but not dense. It is readable and lovingly-commented. [0] https://wren.io/ https://wren.io/
- justin_oaks 3y agoSemicolons seems an odd metric since complexity is often introduced by if-else branches, while loops, and function declarations. Each of those doesn't involve semicolons.
- genezeta 3y agoI don't know, but it might be somewhat tongue-in-cheek since Wren itself doesn't use semicolons at all.
- keepamovin 3y agoI like this person's work. Check it out: https://github.com/janmojzis https://github.com/janmojzis - tinyssh - TinySSH is a small server with less than 100,000 words of code. Language: C. Stars: 1.1k. Forks: 65. - acmeshell - Shell-style client for LetsEncrypt. Language: Python. Stars: 31. Forks: 6. - dq - Recursive DNS/DNSCurve server and command-line tool to debug DNS/DNSCurve. Language: C. Stars: 23. Forks: 1. - pstree - Unix process tree viewer. Language: C. Stars: 14. Forks: 2. - ntpserver - Pure python NTP server. Language: Python. Stars: 11. Forks: 3. - httpfile - Httpfile is an HTTP server derived from publicfile-0.52. A collection of tiny, standard net utils and servers. Gives the impression the person does it to craft something, and to understand. Inspiring and impressive!
- deleted 3y ago[deleted]
- 1oooqooq 3y agosome of those look like spoofs?
- keepamovin 3y agoHow? I guess perhaps to you they would. But why don’t you check it out rather than writing a silly comment?
- Panino 3y ago> dq - Recursive DNS/DNSCurve server and command-line tool to debug DNS/DNSCurve I use dqcache, the DNSCurve-aware recursive resolver from the dq package, and love it.
- vzaliva 3y agoIt looks like a good choice for access to small embedded devices. Except the missing port forwarding feature.
- mrbluecoat 3y agoA potential alternative if you need port forwarding: https://github.com/Matir/sshdog https://github.com/Matir/sshdog
- traceroute66 3y agoI don't see anyone sensible replacing OpenSSH with anything else for two fundamental reasons: 1. OpenSSH has more eyes on it and more deployments than almost any other piece of non-OS/kernel software on the planet. By this stage in its life, it is very mature. Look at the vulnerability database, OpenSSH has not had a serious REMOTE vulnerability for a long time, all the recent vulnerabilities require the attacker to have some form of pre-existing host access (https://www.openssh.com/security.html https://www.openssh.com/security.html). 2. OpenSSH comes from the house of OpenBSD. Those guys are serious about writing secure code and have a well-established track record. These days you can also compile OpenSSH against LibreSSL instead of OpenSSL. Instead of replacing OpenSSH, most people would be better off spending their time switching OpenSSH to key-based-auth only and then making a few simple configuration changes to further harden OpenSSH. Starting with the config ideas proposed by Mozilla[1] and adding in options such as the built-in rate-limiting config options (PerSourceMaxStartups, PerSourceNetBlockSize and friends). [1] https://infosec.mozilla.org/guidelines/openssh https://infosec.mozilla.org/guidelines/openssh
- wibblewobble125 3y agoBad reasons to trust code: * “Many __informal__ eyes have probably looked at it” * Lack of recent __number__ of (known) vulnerabilities * “Serious guys” (appeal to authority) I think you’re using short-hand, but perhaps the short-hand should be different. E.g. * A list of audits by date, independent organization, is provided __here__ which is evidence of review * The vulnerability acknowledgement, correction and release process is prompt, accurate and detailed, which is documented __here__ * XYZ coding, testing, fuzzing, proving, bounty, integration with other systems, documentation, defaults etc. practices are used in the interest in hardening the code, limiting moving parts, attack radius, etc.
- traceroute66 3y ago> I think you’re using short-hand Yes I was using short-hand. Because you're the only one here trying to make the stupid argument that OpenSSH code is somehow not trustworthy. Frankly, if you don't trust OpenSSH code for the reasons you suggest, then you should not be trusting any Operating System, whether BSD, Linux, Mac or Windows. As I said, OpenSSH is used extensively, INCLUDING in security-critical environments, the sort of security-critical environments that you can be sure have done their homework, even if they don't publish it. The simple fact of the matter is this: Given the widespread global deployment of OpenSSH for DECADES now, if there were shortcomings in the code, you would have heard of it because we would be seeing BILLIONS of compromised endpoints. Fact is, there aren't, unless you haven't bothered to update your system in the last decade. So you can talk about fuzzing or whatever until you are blue in the face, but widespread global deployment is hard to beat, because that's REAL WORLD, failed attempts at finding zero-day exploits and all !
- aAaaArrRgH 3y agoGiven that it's a small SSH server, I wonder how feasible it would be to rewrite it in a memory-safe language. C doesn't feel like the most security-conscious (and, quite frankly, legible) language in this day and age.
- AceJohnny2 3y ago> State-of-the-art crypto: ssh-ed25519, curve25519-sha256, chacha20-poly1305@openssh.com > Older standard: ecdsa-sha2-nistp256, ecdh-sha2-nistp256, aes256-ctr, hmac-sha2-256 removed in version 20190101 Bah! I've soured on ed25519 because two of the tools I depend on have lackluster support. We have one tool that leverages Macbook TouchID as a hardware keystore, and it doesn't support ed25519, only ecdsa (I don't know whether this is a TouchID or a tool limitation, I suspect tool). The other is that recent versions of Gerrit, which leverages Apache SSH, will crash the SSH connection when presented with some ed25519 certificates, which is funny since Gerrit does not support certificates! I really wish ed25519 was more widely and better supported, or that TinySSH supported ECDSA.
- kureikain 3y agoI think for these use case a SSH server in Go would be way simpler such as https://github.com/gliderlabs/ssh https://github.com/gliderlabs/ssh
- zoobab 3y agoI would have redone in ZeroMQ+CurveCP, probably way less lines of code since most of what you need should be already there.
- katejmurchison 3y ago[dead]