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.