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

nix-installer breaks sshd in Alpine Linux container. #692

Closed
derekmahar opened this issue Oct 28, 2023 · 1 comment · Fixed by #801
Closed

nix-installer breaks sshd in Alpine Linux container. #692

derekmahar opened this issue Oct 28, 2023 · 1 comment · Fixed by #801
Labels
bug Something isn't working Linux
Milestone

Comments

@derekmahar
Copy link

derekmahar commented Oct 28, 2023

After nix-installer 0.14.0 installs Nix 2.18.1 in an Alpine Linux container, sshd stops working and fails to start:

alpine-1:~$ /nix/nix-installer --version
nix-installer 0.14.0
alpine-1:~$ nix --version
nix (Nix) 2.18.1
alpine-1:~$ ps aux | grep sshd
  455 derek     0:00 grep sshd
alpine-1:~$ sudo /etc/init.d/sshd start
/var/empty must be owned by root and not group or world-writable.
 * ERROR: sshd failed to start
alpine-1:~$ ls -la /var/empty
total 8
drwxr-sr-x    2 nixbld32 nixbld        4096 Nov 22  2022 .
drwxr-xr-x   13 root     root          4096 Mar 25  2023 ..

sshd fails to start because it seems that nix-installer sets the owner of directory /var/empty to nixbld32 and group to nixbld, but sshd requires that root owns this directory. After manually changing the owner of /var/empty from nixbld32 to root and group from nixbld to root, sshd can start:

alpine-1:~$ sudo chown root:root /var/empty
alpine-1:~$ ls -la /var/empty
total 8
drwxr-sr-x    2 root     root          4096 Nov 22  2022 .
drwxr-xr-x   13 root     root          4096 Mar 25  2023 ..
alpine-1:~$ sudo /etc/init.d/sshd start
 * Starting sshd ... [ ok ]
@Hoverbear Hoverbear added bug Something isn't working Linux labels Oct 30, 2023
@Hoverbear Hoverbear added this to the 0.14.1 milestone Oct 30, 2023
@Hoverbear
Copy link
Contributor

Thanks for this report, will try to get a fix in next release. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Linux
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants