Ssh

Lock Gnome Screen via SSH

Akira Ueno
Overview I want to lock gnome-session(Desktop) with a user logged in via ssh. Script Save below script and execute it. There are two key points at line 10. 1. gnome-screensaver-command -l Execute gnome-screensaver-command as GNOME logged in user. 2. DBUS_SESSION_BUS_ADDRESS Set dbus environment varibale to execute gnome-screensaver-command. Reference https://askubuntu.com/questions/7776/how-do-i-lock-the-desktop-screen-via-command-line https://askubuntu.com/questions/707984/lock-screen-with-gnome-screensaver-command-as-root-from-etc-pm-sleep-d-script