How do you log out in the most recent version of Ubuntu from a local terminal?

  • Control + Alt + Backspace... Not sure this is a safe logout, but probably the quickest! May 25, 2010 at 20:15
  • 2
    @Wil: Ctrl-Alt-Backspace is disabled in recent ubuntu builds. it was the traditional emergency-kill-X-windows, but it was implemented in the X server itself and has been removed. you can add it back as a standard keyboard shortcut if needed. but killing X-windows isn't exactly the same as logging out gently. :) May 25, 2010 at 21:34
  • @quack quixote, I didn't write as an answer because I know it isn't exactly good! I never said gently! Anyway, +1 very interesting, I am only on Ubuntu 8.04 and had no idea it is no longer used in recent builds. May 25, 2010 at 21:42
  • @wil: i think it was first disabled in Jaunty (9.04); there was a package called dontzap you could install to re-enable (it was still an X-server option then). anyway see wiki.edubuntu.org/X/Config/DontZap for details. there's some further discussion of other emergency keyboard shortcuts at the bottom of the page. May 25, 2010 at 21:49

2 Answers 2


I use this:

gnome-session-save --logout-dialog
  • 2
    that's (certainly) the way to logout GNOME, not GDM (I use i3 as window manager, so it can't work!)
    – Kevin
    Aug 16, 2011 at 8:24

sudo /etc/init.d/gdm stop

or restart if you want to log in as a different user:

sudo /etc/init.d/gdm restart

  • 1
    This doesn't work as recent versions of Ubuntu use upstart instead of a SysV init script to start gdm. Use "sudo service gdm stop" instead. Like Control + Alt + Backspace this kills the X server (together with gdm). To just logout the current user Thomas Leonard's solution is usually better. May 26, 2010 at 14:06
  • Sorry, it works, but is deprecated (for some reason I can't edit mycomment above anymore) May 26, 2010 at 14:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .