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

Azure Linux sets permissions of root directory to 0750 by default, preventing non-root users from logging in #10042

Open
surfacepatterns opened this issue Aug 6, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@surfacepatterns
Copy link
Contributor

Describe the bug
While creating an Azure Linux 3.0 WSL instance, I noticed that I couldn't log in as the default (non-root) WSL user I created as root. The error messages I received were only somewhat helpful:

sh-5.2# sudo -u danderson -i
sudo: unable to change directory to /home/danderson: Permission denied
sudo: unable to execute /bin/bash: Permission denied

I found the problem to be restricted permissions on the root directory:

sh-5.2# ls -lad /
drwxr-x--- 18 root root 4096 Aug  6 15:48 /

When I changed the permissions to 0755, things worked correctly:

sh-5.2# chmod 755 /
sh-5.2# sudo -u danderson -i
danderson [ ~ ]$

To Reproduce
Steps to reproduce the behavior:

  1. Generate an AzureLinux 3.0 tarball.
  2. Add the tarball to WSL.
  3. Create a non-root user.
  4. Attempt to use sudo to change to that user

Expected behavior
I expect to be able to change to a non-root user.

@surfacepatterns surfacepatterns added the bug Something isn't working label Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant