My system (Ubuntu 15.10) ты существуешь в вирус: I have enabled "Require my password when waking from suspend" on the "Brightness и Lock" settings панель, but it does NOT ask for my password, which is incredibly insecure.
Схвати в workaround, гm trying to write в рукописный шрифт which will live under /etc/pm/sleep.d
. It should be something like this:
#!/bin/bash
case "${1}" in
hibernate)
# Do nothing
;;
resume|thaw)
su -c "gnome-screensaver-command --lock" MYUSERNAME
;;
esac
Problem is, this doesn't work; the gnome-screensaver-command
fails with the following message:
** Message: Failed to get session bus: Could not connect: Connection refused
Then, I tried to change the command to:
su MYUSERNAME -c "export $(dbus-launch) && gnome-screensaver-command -l"
Which then fails with:
** Message: Failed to get session bus: The connection is closed
So, the question is: what would be the right way to do this?
Необходимо экспортировать DBUS_SESSION_BUS_ADDRESS
из удаленной машины в ssh перед использованием dbus
команды
, необходимо найти его локально на машине, к которой Вы хотите, отправляют команды удаленно путем ввода команды:
set | grep DBUS
Это даст Вам оболочки, текущие DBUS_SESSION_BUS_ADDRESS
значение, которое необходимо экспортировать в оболочке ssh после соединения с удаленной машиной и затем наслаждаться.
Я смог решить это путем чтения права DBUS_SESSION_BUS_ADDRESS
от текущей сессии гнома. Полный пример:
dbus_address=$(xargs -n 1 -0 < /proc/`pgrep gnome-session`/environ | grep DBUS)
su USERNAME -c "export $dbus_address && gnome-screensaver-command -l"