News for hackers. Stuff that matters.
Re:Tailscale SSH by riobard on Wednesday June 22, 2022 @11:53AM (#31837676)
I'll have to ask this since it's bothering me for quite a while…

If I connect to a server via WireGuard, would it make more sense to run simpler & unencrypted `rsh` instead of `ssh`? It's kinda pointless to double encrypt.

Re:Tailscale SSH by bradfitz on Wednesday June 22, 2022 @11:55AM (#31837707)
Yeah, but e.g. no rsh (or telnet!) on macOS.

It's likewise a bit silly that we had to add TLS support to Tailscale: https://tailscale.com/blog/tls-certs/

But we want to interoperate well with the clients people already have (browsers, their system ssh client, etc...)

Re:Tailscale SSH by oefrha on Wednesday June 22, 2022 @12:38PM (#31838282)
From the blog post on TLS support:

> However, if your service doesn’t have a valid TLS certificate, despite the fact that your connection is encrypted using Tailscale, your browser will warn you that the connection is not secure (it’s doing the right thing—it doesn’t know about Tailscale!). So, to avoid confusing your users, you might want to provision a TLS certificate to validate your internal services.

Browser warnings and user confusion aren’t the only consequence of not using HTTPS. The more concrete impact is that you lose access to a large and growing number of web APIs that are restricted to secure contexts.

https://developer.mozilla.org/en-US/docs/Web/Security/Secure...

Re:Tailscale SSH by bradfitz on Wednesday June 22, 2022 @12:42PM (#31838362)
Yup! In fact, that was the very first sentence of the original GitHub bug about TLS certs: https://github.com/tailscale/tailscale/issues/1235 ... "Many new web APIs (eg: geolocation, sensors, http/2, etc) require a TLS certificate"
Re:Tailscale SSH by runjake on Wednesday June 22, 2022 @12:23PM (#31838083)
FWIW for those reading (I figure Brad already knows):

    echo "alias telnet=nc -v" >> ~/.zshrc && source ~/.zshrc
Re:Tailscale SSH by apenwarr on Wednesday June 22, 2022 @12:25PM (#31838115)
Alas, the real “telnet” protocol has considerably more fanciness than nc. It’s just that the telnet cli command degrades into a simple line-oriented mode if it doesn’t see the telnetd init sequence.
Re:Tailscale SSH by runjake on Wednesday June 22, 2022 @12:41PM (#31838340)
True, but it handles 99% of the use cases of the people who lament the demise of telnet in macOS. :-)

For the rest: brew install telnet

Re:Tailscale SSH by Brian_K_White on Wednesday June 22, 2022 @12:59PM (#31838649)
macports please
Re:Tailscale SSH by runjake on Wednesday June 22, 2022 @01:27PM (#31839058)
Here you go:

    sudo port install inetutils
Re:Tailscale SSH by Brian_K_White on Wednesday June 22, 2022 @01:39PM (#31839217)
Better. Thank you :)
Re:Tailscale SSH by jackthetab on Wednesday June 22, 2022 @02:51PM (#31840206)
I read that in Chris Rock's voice. :-)
Re:Tailscale SSH by ithkuil on Wednesday June 22, 2022 @04:29PM (#31841470)
For example window size negotiation
Re:Tailscale SSH by throwaway894345 on Wednesday June 22, 2022 @12:16PM (#31837976)
Is there an option to avoid double encryption on systems that do have e.g. rsh?
Re:Tailscale SSH by dangerlibrary on Wednesday June 22, 2022 @12:44PM (#31838402)
I might be misunderstanding the question but ... just use rsh?
Re:Tailscale SSH by raggi on Wednesday June 22, 2022 @05:39PM (#31842195)
Around the time I joined Tailscale, actually just before, I had a look at rsh with an eye in this direction.

The problem is that rsh is very stale and unmaintained - even those versions that have had releases in recent years (e.g. GNU Inetutils) are very old inside - even if they've kept up with patches, they have not kept up with features e.g. modern user session construction.

It also turns out that ssh the client, much more so than ssh the protocol, is really a key integration point and API that users end up needing. It has a broad feature set that turns up in use cases all over, many of which rsh does not handle.

Re:Tailscale SSH by throwaway894345 on Wednesday June 22, 2022 @03:17PM (#31840544)
I think for the same reasons I wouldn't "just use ssh" over tailscale--I don't want to have to manage an sshd that doesn't require key or password auth but listens over tailscale (and nothing else!). Basically, what I want is for tailscaled to be my rshd (appropriately configured for connections over tailscale network only, etc) or in other words to avoid double-encryption (it's not the end of the world, but ideally we don't need to doubly-encrypt).
Re:Tailscale SSH by structural on Wednesday June 22, 2022 @05:59PM (#31842399)
Double (or more) encryption ends up happening a lot in larger networks not for technical reasons but for policy ones.

This is unsurprising, because it is used for different purposes in different layers of the stack. It is not at all a black and white state of "encrypted" vs. "not encrypted".

For example, in one organiztion I've worked with, Wireguard (generally, including Tailscale) is approved for restricting connections only to authorized network devices/users and that data maintains integrity in transit, but is not approved for protecting the confidentiality of sensitive information. Connections which access specific resources are required to be encrypted at the application level using a mechanism which has been approved for that information type (given a specific threat model).

So you could transmit very small amounts of data over TCP/IP, over a Tailscale network, using a set of pre-shared, one-time pads. And you might actually want to do this! It's really not ridiculous, but you do need to assess whether you really do have a threat model that needs it.

Re:Tailscale SSH by pehtis on Wednesday June 22, 2022 @12:51PM (#31838517)
You can still use telnet v1.9.4 on macOS. Just copy it from an old version of OSX (pre High Sierra). It still works fine on Monterey.
Re:Tailscale SSH by dsr_ on Wednesday June 22, 2022 @11:58AM (#31837755)
Yes and no. You shouldn't have rsh on your system at all -- there's a case for telnet to test connections (though netcat is better), but there's no case for rsh.

ssh used to allow setting cipher=none, but that's not available anymore.

Think of it this way: you're paying the small overhead of double encryption, but you're gaining not fatfingering your way to a password compromise.

Re:Tailscale SSH by throwaway894345 on Wednesday June 22, 2022 @12:15PM (#31837958)
I'm not following. How does double encryption help to avoid a password compromise if everything is authed with tailscale in the first place?
Re:Tailscale SSH by 8organicbits on Wednesday June 22, 2022 @12:32PM (#31838202)
I suspect they mean that if you have rsh installed for tailscale you need to be very careful with how you run it. If you accidentally let rsh listen on 0.0.0.0 and don't firewall it then you've given attackers a way to guess passwords.

Forgetting to firewall services or accidentally exposing services to the internet is pretty common. ssh is more hardened than rsh, especially with key based auth, so the risk is lower.

Re:Tailscale SSH by throwaway894345 on Wednesday June 22, 2022 @03:08PM (#31840445)
Isn't this true of SSH as well? What's stopping someone from letting sshd listen on 0.0.0.0 with password auth? Anyway, I would expect that whether you're using ssh or rsh/telnet/etc that you're not configuring it for password auth, but rather using tailscale authentication. Specifically, I would expect (perhaps naively) that tailscaled handles the ssh/telnet/rsh/whatever connections rather than passing them off to another process (sshd, telnetd, etc) and thus allowing it to handle the authentication and daemon configuration (e.g., what address it listens on).
Re:Tailscale SSH by xgbi on Wednesday June 22, 2022 @01:41PM (#31839240)
Somebody listening on local connections can sniff your password.
Re:Tailscale SSH by throwaway894345 on Wednesday June 22, 2022 @03:09PM (#31840466)
How does that work? First of all, I would expect that rsh-over-tailscale doesn't use password authentication, and secondly can a local user sniff traffic before it hits tailscaled?
Re:Tailscale SSH by runjake on Wednesday June 22, 2022 @12:25PM (#31838106)

    > would it make more sense to run simpler & unencrypted `rsh` instead of `ssh`?
No, because ssh has evolved to be so much more than "rsh with encryption".
Re:Tailscale SSH by ben174 on Wednesday June 22, 2022 @12:40PM (#31838317)
Double encryption is twice as effective. I use double ROT-13 for double the security.
Re:Tailscale SSH by efunneko on Wednesday June 22, 2022 @03:44PM (#31840919)
I find it more efficient to just use ROT-26
Re:Tailscale SSH by Shared404 on Wednesday June 22, 2022 @03:47PM (#31840946)
ROT-26? Hasn't that been broken for a few years now?

We all need to be shifting to ROT-52 ASAP.

Re:Tailscale SSH by fragmede on Wednesday June 22, 2022 @12:45PM (#31838421)
Is it pointless? SSH doesn’t send the password out over the wire but instead uses a challenge-response cryptographic system so even if one of the interim machines is compromised, they don’t have access to the clear text password. You shouldn’t be raising passwords (or even passwords in the first place with ssh) but practice defense in depth.

Unless you’re transferring large files the overhead of double encryption on ssh is totally blown away by waiting for human input.

IIRC There’s a fork of SSH that supports not encrypting things if you are trying to transfer large files.

Re:Tailscale SSH by Helitico on Wednesday June 22, 2022 @01:07PM (#31838762)
Stay secure by default.

CPU overhead for encryption is basically non existend.

Re:Tailscale SSH by soraminazuki on Wednesday June 22, 2022 @12:59PM (#31838652)
In this case, double encryption is a good idea though. Tailscale is a great way to reduce exposure of your infrastructure from the public internet, but it’s not without flaws. In theory, it should be possible for Tailscale and your SSO provider to add new nodes to your Tailnet. Though I don’t believe this is something that they’re actually willing to do, it’s definitely something to keep in mind if you’re planning on delegating SSH/sudo authentication to Tailscale.
Re:Tailscale SSH by jgeralnik on Wednesday June 22, 2022 @04:46PM (#31841659)
Double encryption doesn't actually help in that case though - if tailscale (maliciously) added nodes to your network the ssh session being encrypted wouldn't change the fact that they can run commands on your machines. And if they wanted to actively MITM you they could do so (by redirecting your wireguard connection to a server owned by them) even with encryption (presuming they can fake the host key, which they could do at worst by running code on your server to steal it).

To be clear I implicitly and explicitly trust tailscale not to tamper with my networks and if your threat model includes tailscale becoming a bad actor you should remember that in that case running their binary in the first place could already be game over.

Re:Tailscale SSH by soraminazuki on Wednesday June 22, 2022 @09:16PM (#31844037)
Double encryption should help as long as the Tailscale client installed on your own machines is safe. Without double encryption for SSH, Tailscale and your SSO provider can theoretically run commands on your machines without involving malicious client software. But that's not possible if you encrypt your SSH connection with your own keys.

Also for Linux, the Tailscale client is fully open source and I obtain the binary from the distro. I find that a bit reassuring.

Re:Tailscale SSH by jgeralnik on Thursday June 23, 2022 @01:40AM (#31845534)
But that's the thing - even with double encryption tailscale and your SSO can run commands on your machines

1) Run tailscale --ssh on your server 2) A malicious SSO or tailscale add a new machine to your network and update your ACL such that the new machine can connect to your server 3) ssh from the new machine to run code on your server

The fact that the connection between the malicious machine and your server is double encrypted doesn't affect the attack here at all

Re:Tailscale SSH by soraminazuki on Thursday June 23, 2022 @10:05AM (#31849296)
By double encryption, I mean using an SSH server other than "tailscale --ssh". No one except yourself can have SSH access if you disable Tailscale's builtin SSH server, use OpenSSH, and generate your own keys for authentication.
Re:Tailscale SSH by jgeralnik on Friday June 24, 2022 @01:23AM (#31858080)
Ah, I don't think that's exactly what this thread was about. Ignoring how authorization works, the question was whether there is an advantage to encrypting your commands again (via say ssh) vs. just sending them in plaintext under wireguard (via say rsh)
Re:Tailscale SSH by Spooky23 on Wednesday June 22, 2022 @12:50PM (#31838502)
Not really. Who knows what you’re connecting to once you connect to the tailscale endpoint.

It’s more likely that you’re gonna screw up and end up doing something you don’t intend to do for very little gain. SSH overhead in 2022 is really low.