fsquillace / junest

The lightweight Arch Linux based distro that runs, without root privileges, on top of any other Linux distro.
GNU General Public License v3.0
2.08k stars 111 forks source link

Sharing .junest with another user? #272

Closed ayaka14732 closed 2 years ago

ayaka14732 commented 2 years ago

I am trying to share .junest with another user (named testuser), so that testuser can reuse my junest configuration.

However, if I make .junest accessible for testuser with setfacl, testuser will still get an error:

$ ln -s /home/ayaka/.local/share/junest /home/testuser/.local/share
$ ln -s /home/ayaka/.junest /home/testuser
$ export PATH=~/.local/share/junest/bin:$PATH
$ junest
cp: cannot create regular file '/home/testuser/.junest//etc/host.conf': Permission denied
/home/testuser/.junest/usr/bin/cp: cannot create regular file '/home/testuser/.junest//etc/host.conf': Permission denied

If I change the write permission recursively of .junest with setfacl, testuser will be able to run junest. However, pacman will complain about the wrong directory permissions:

warning: directory permissions differ on /etc/
filesystem: 775  package: 755
warning: directory permissions differ on /usr/
filesystem: 775  package: 755
warning: directory permissions differ on /usr/bin/
filesystem: 775  package: 755
...

and I am not sure if it is the right way to do this.

fsquillace commented 2 years ago

Generally, junest has not been design as multi user in mind.

You'd need to allow testuser to write to directories which belongs to the original user. To do that you may need to use chmod and allow the group of the directory ~/.junest to write into it and assign testuser to that group.

Another option is to use the junest option --no-copy-files to avoid junest populating ~/.junest/etc/host.conf on your behalf. This may not solve the problem entirely given that programs within junest may still need to do some writing into the ~/.junest directory.

Solving this as it is not strictly a junest related issue.

ayaka14732 commented 2 years ago

Thanks for the reply.

and assign testuser to that group

But assigning user to a group requires root privilege.

fsquillace commented 2 years ago

Indeed! I forgot you may have not root privileges :/ Strange that setfacl did not work well though.