Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

In Ubuntu 11.04, Ctrl-Alt-Del gives me a menu with shutdown, hibernate, suspend and restart, but no logout. Is there a key combination to logout of Ubuntu? Is there a way to provide one?

share|improve this question
    
If future searchers want to know. I can type Ctrl+Alt+L in 12.04 to lock screen. –  AWE Aug 26 '14 at 6:33

6 Answers 6

up vote 18 down vote accepted

Creating custom keyboard shortcuts:

For 12.04 LTS and later:

To add a new shortcut open System Settings -> Keyboard and choose the Shortcuts tab:

enter image description here

Press the '+' sign on the bottom left to enter the name of your custom shortcut and the command you want to run (e.g. gnome-session-quit --logout --no-prompt). After having applied this you are able to select the line of your new shortcut. Then press the desired key combination. In case the key combination already exist we will have to delete this first.

For 14.04 LTS and later:

In a default Unity session the new logout dialog is presented needing another at least two keystrokes to select poweroff from the menu:

enter image description here

The old dialog with a 60 s timeout will only be displayed in a gnome-flashback session.

share|improve this answer
    
Thanks for the effort of putting this answer together! I'd be interested to know if "System Settings -> Keyboard -> Shortcuts tab"... described here has the same effect as "Gnome Control Center -> Keyboard" described by @enzotib (for 11.10) –  drevicko Oct 20 '11 at 2:54
    
@drevicko The menu entry System Settings calls the Gnome Control Center, so yes, its the same. –  Takkat Oct 20 '11 at 6:11
    
Excellent It the same trick for 12.04. –  Papachan May 6 '12 at 13:07

Another way is to restart lightdm. In 14.04 that would be sudo service lightdm restart and in 15.04 systemctl restart lightdm

share|improve this answer

In Ubuntu 1204 there are two out-of-the-box solutions:

  1. "Run a command" technique:

    Alt-F2 | type gnome-session-quit

  2. "Indicator menu" technique:

    Alt-F10 | arrow right or left to gear icon | arrow down to Log Out...

In each case, confirm logout by hitting Enter. A bug in Ubuntu for #1 is that if you login and do nothing and hit Alt-F2 you get Dash (to run programs). Just hit Esc and try again with Alt-F2 and you'll get the "Run a command" instead this time.

share|improve this answer

If you are using Unity (the default environment in Ubuntu 11.04 and later) then you can press the Super key (aka the Windows key) to bring up the dash, type in "log" and the first option is "Log Out" so just press Enter. This will bring up a dialog box to confirm whether you want to log out, with the "Log Out" button already selected, so press Enter again. And you're logged out.

share|improve this answer
    
"Log Out" does not appear in my dash.. –  drevicko Oct 20 '11 at 2:52
    
@drevicko: I've only actually tested this on 11.10, so it is possible it doesn't works with 11.04. –  Hamish Downer Oct 20 '11 at 16:55

I think You can just make custom shortcut for "gnome-session-quit --logout --no-prompt" without any bash scripting.

share|improve this answer

In Ubuntu 11.10 you could write a script containing

#/bin/bash
gnome-session-quit --logout --no-prompt

make it executable with chmod +x script-name, then set a global shortcut to execute this script in Gnome Control Center -> Keyboard.

In previous Ubuntu versions there was gnome-session-save --logout.

share|improve this answer
    
In 11.10 the default action on Ctrl+Alt+Del is to logout. –  Takkat Oct 19 '11 at 7:09
    
@Takkat: you're right, I assumed the OP do not want it to ask for confirmation. –  enzotib Oct 19 '11 at 7:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.