nix-community / nix-user-chroot

Install & Run nix without root permissions [maintainer=@Mic92]
MIT License
274 stars 25 forks source link

No user exists for uid when using ssh or whoami #112

Open DCsunset opened 1 year ago

DCsunset commented 1 year ago

Within nix-user-chroot ~/.nix bash, the program whoami and ssh stop working because it cannot find the user for the uid.

The uid doesn't change after running nix-user-chroot, but for some reason it can no longer find the user.

A similar issue is https://github.com/NixOS/nixpkgs/issues/64665 but the solution no longer works since there's no libnss_sss.so.2 in my system.

alecandido commented 10 months ago

I guess it is working similarly to the containers runtimes, and the uid inside nix-user-chroot shell doesn't match to the uid on the host, but there is a non-trivial mapping.

https://en.wikipedia.org/wiki/Linux_namespaces#User_ID_(user)

However, I'm also looking for an option to make ssh (and therefore Git operations based on SSH) working within nix-user-chroot.

Moerliy commented 3 weeks ago

I have run into this too. Especially with git. Has anyone ran into a solution for it?