1

I searched but could not find how to suspend particular user in Ubuntu 12.04. I found the following option:

dbus-send --system --print-reply \
    --dest="org.freedesktop.UPower" \
    /org/freedesktop/UPower \
    org.freedesktop.UPower.Suspend

However suspend the current user. I want root user to suspend another user. How to do this ?

Krasimir
  • 1,153

1 Answers1

2

As root we can kill all processes of a user with:

sudo pkill -u <username>

After that lightdm will present the login screen.

Note that this will immediately terminate all applications a user had run. Unsaved data will therefore be lost.

To disable a user account see How to enable or disable a user?

Takkat
  • 142,284
  • This means that instead of suspend do disabled? I also want to ask if you disabled all processes are killed automatically ? – Krasimir Sep 14 '15 at 08:16
  • I wanted to ask when I make a disabled user. Unless disabled and suspend are the same ? – Krasimir Sep 14 '15 at 08:23
  • 1
    Disabled = the user can no longer log in. Suspend = the computer is in powersafe suspend-to-ram-state. Pkill = a logged in user is logged out, and all their processes incl. running applications are terminated. – Takkat Sep 14 '15 at 08:26