Skip to content
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

Ability to configure the authorized_keys file #257

Open
Atemu opened this issue Oct 23, 2023 · 2 comments
Open

Ability to configure the authorized_keys file #257

Atemu opened this issue Oct 23, 2023 · 2 comments

Comments

@Atemu
Copy link

Atemu commented Oct 23, 2023

I've got a use-case where I want to run a secondary unprivileged sshd that has its own set of settings and should not inherit the user config. Additionally, I want to only allow a certain key to connect to it.

In openssh, there is the AuthorizedKeysFile option that I can point at a crafted file for that purpose but openssh is being annoying trying to berate me how I should set up permissions for my host key (I don't care that /tmp/'s permissions aren't "secure" for my unprivileged sshd; TYVM).
I'm not aware of an equivalent option in dropbear; would be great if such an option could be added.

Edit: For anyone else coming across with the same issue: StrictModes=no disables this behaviour in OpenSSH.

@mkj
Copy link
Owner

mkj commented Nov 26, 2023

Dropbear will have the same warning about authorized_keys permissions, fwiw

@opk12
Copy link

opk12 commented Dec 12, 2023

What about AuthorizedKeysCommand (manpage)? I think it would also solve the permissions problem, if one used cat ... or echo ....

My use case is a container / hardened chroot. dropbear is lighter and simpler to configure than OpenSSH. To ssh into an unprivileged container (therefore single-user), I need to match the socket file's Unix perms / ACLs and do not need a key. If dropbear requires a dummy key, it could go into systemd's LoadCredential= directory (systemd's idiomatic way) or another shared directory; but it would be cleaner to hard-code the key into the container config file, in the dropbear command line (echo).

Also, if the systemd hardening option DynamicUser= is enabled, it picks a random, unused UID and auto-generates an /etc/passwd entry with the home set to /. dropbear uses that, does not check $HOME, and ends up with /.ssh/authorized_keys, which is not a very clean container setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants