-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support port-forwarding restricted ssh login #26
Comments
Hi, thanks for copying this over. This restricted setup worked up until the 1.3 update btw. |
Hey @karlbeecken, I think your issue should be solved by adding additional ssh arguments. Could you please test? It's probably something like -N or -T |
Thanks, it was I think it is a good idea to limit access for machine-to-machine SSH keys as much as possible, because as they are typically not secured by a passphrase, they are especially vulnerable if the file gets "lost" somehow. So I would suggest that the restricted access for the key gets introduced into the addon setup message, so anyone with a copy-and-paste setup has this more secure approach by default. |
The -N is already a default :) home-assistant-addons/autossh/config.yaml Line 26 in ecd5aa9
|
Alright, then I must have deleted it by accident 🙈 |
Btw I work with a dedicated ssh service inside a docker, which is then also linked to traefik for let's encrypt. Might be interesting for you as well. (The restriction is still meaningful.) Would you like to offer a PR?
Thanks! |
Hey Karl, |
Hi Thomas, sorry for the delay, I would be still interested but I have a question: Should we apply the restriction by default or make it an option somehow? If we want to add it by default, we could simply print the restricting entries in front of the pubkey during the setup "please add this key" message. |
Happy to hear that! How about we add a bit of explanation to it. After all, not even I was aware of these additional restrictions so far. A short "Btw this first parts adds more security to your setup" would be more than enough. As for your restriction: I'd suggest to not include the explicit permitopen and I believe we can leave out command? |
I restricted the user on the server to only allow tunneling. This is the relevant section out of the
authorized_keys
:command="",restrict,port-forwarding,permitopen="localhost:8123"
restrict
will disallow pty, so this will probably be the reason of the error, but why would the addon try to open a pty? I have a similar setup running with autossh in a systemd service and a similarly restricted user which does not have this problem.Originally posted by @karlbeecken in #24 (comment)
The text was updated successfully, but these errors were encountered: