Run dropbear as for a single non-root user #347
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Attached some minor adaptions to run a non-root dropbear service and also change the location of the hostkeys used to a user enabled or custom location.
Added 2 cmdline options:
-H default location for hostkeys
this enables to specify in default_options.h the bare hostkey filenames.
in svr-runopts it is determined if you start dropbear as root (location /etc/dropbear) or as non-root (location ~/.ssh)
-U: specify a forced userid
So whatever you type in as username, you will be login with the forced userid... and as bonus the envvar SSH_ORGUSER will be set with the typed in username.
So this way you can still run as root, but always be forced to a certain user and also know which user was requested.
We use this to have dropbear acting as a user service, since we don't have any root rights or /etc access.