0

So root invoked some script, and specific user session should be locked. I managed to get this working before, but now I cannot win.

Currently I'm following this article: https://0day.work/locking-the-screen-when-removing-a-yubikey/ everything is just fine only to last step, actual locking.

this command is invoked:

# echo $DISPLAY
:0

# echo $XAUTHORITY
/home/mmucha/.Xauthority

# su "mmucha" -c "/usr/bin/gnome-screensaver-command --lock"
Can't connect to screensaver!

same for:

runuser -l mmucha -c 'export DISPLAY=:0;export XAUTHORITY=/home/mmucha/.Xauthority;gnome-screensaver-command -l'

what am I missing?

EDIT: ubuntu 18.04, running cinnamon-desktop, however this probably does not have any influence. It does not work equally for cinnamon-screensaver-command and for gnome-screensaver-command.

0 Answers0