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

Restricted modes do not apply to root #77

Closed
rocktale opened this issue Feb 18, 2022 · 2 comments
Closed

Restricted modes do not apply to root #77

rocktale opened this issue Feb 18, 2022 · 2 comments

Comments

@rocktale
Copy link

If the root account is enabled via SSH_ENABLE_ROOT=true the restricted modes do not seem to apply to the root account, i.e. one can still login via SSH getting a regular shell login. After checking the entrypoint script, I realized that it only applies the restricted shell etc. to the configured users via SSH_USERS.

I think, this behavior should at least be documented. However, I was wondering if there is a specific reason to exclude the root account from the restricted modes since I'd prefer to use root (for simplicity with access rights for the keys files as well as the files written via rsync) but still have the added security of restricted access.

@kat1440
Copy link

kat1440 commented Dec 24, 2022

How can I be restricted access if the root is everywhere sees everything knows all how in fact is there restricted access. Blank to anything if he's not restricted at all

@macropin
Copy link
Member

@rocktale SSH_ENABLE_ROOT is not recommended, we don't use it.

You might be able to achieve what you're looking for using group membership and the new #76 options.

It's definitely possible to achieve what you want using https://github.com/panubo/docker-sshd#custom-scripts. You could create a second user with UID/GID 0 and using the restricted shell.

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

No branches or pull requests

3 participants