I am logged in as user1 and want to start a program1 with sudo user2:

sudo -u user2 program1

But home of user2 is encrypted. So program1 exits because it can't write to it's settings folder. How can I solve this problem?

One solution to this problem is to use

ssh -X user2 program1

But I am interested if it is also possible with sudo.

  1. You could just login as the other user (login in a terminal is fine), thus decrypting their home, and run programs successfully. Apparently your ssh -X idea should do that, but doesn't appear necessary for a local user.

  2. Tell the program you're trying to run (program1 in your example) to use a different folder, one that's currently mounted / writeable. How to do that would vary according to each program. Maybe using a "dummy" home folder might work, a temporary link, etc.

  3. Manually decrypt / mount the other user's home. You'd need to know their login passphrase (or actual mount key) and I'm sure just logging in as the other user would be easier.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.