How To Enable Automatic Logon In Ubuntu And Kubuntu
I'm a long time Windows user and recently started playing with Linux and Ubuntu. I am finally getting comfortable with Ubuntu but still have a learning curve when it comes to configuration and customizing the desktop to my preference. One thing I always enable on my Windows PC is automatic logon. Can auto login be enabled in Ubuntu?
When it comes to any Linux distribution, if it can be done in Windows, it definitely can be done in Linux.
To enable automatic logon in Ubuntu, you will need to open and run GNOME Display Manager (also known as Logon Window Preference) as root.
Start by bringing bring up the Run Application window from the keyboard by pressing Alt+F2 and proceed the command with gksu by typing the following:
gksu /usr/sbin/gdmsetup
then click Run and enter your password.
NOTE: Screen shots are from Ubuntu and Kubuntu 7.04 Fiesty Fawn, but should be similar in previous versions.

In Kubuntu, bring up the Run Application window from the keyboard by pressing Alt+F2 and type the following:
kdesu /usr/sbin/gdmsetup
then click Run and enter your password.

In the Login Window Preferences, select the Security tab and check the box next to Enable Automatic Login. If necessary select the user account to enable automatic login. Click Close to save settings.

The next time you boot your computer, you will not need to login anymore!
Remember, while auto login is convenient, it is a security risk, and you should make sure there are no risks involved before allowing auto login on your Ubuntu or Kubuntu computer.
Filed under Ubuntu And Linux Tips by
Leave a Comment

Comments on How To Enable Automatic Logon In Ubuntu And Kubuntu
these instructions are not useful to Kubuntu users, as it utilises a gnome specific program…
Thank you for this site. I used your directions for auto login in ubuntu. GOOD JOB!!!!!!
I used sudo instead of gksu and it worked just fine. Boots up faster now.
It took several minutes to load gdmsetup to change it, but, it worked fine.
So if anyone else runs the command with sudo, and it seems like gdmsetup is not going to start for you, just give it a few minutes as it takes some time to load it up. At least it did on my system, which is, running Ubuntu Harty Heron.
@teddyhcraig
Good tip about using sudo. That's what's cool about Linux, many ways do things and no one way is wrong (maybe just a little more efficient!).
What about Kubuntu?
Is there any way of logging in a user but still asking for the password?
@Jason
…then what's the point of having auto logon? What you are asking is the same as not enabling auto logon.
No I want it to boot into my logon and run whatever aplications I have set up to run, so that I am not waiting the same amount of time again as booting. If that makes sense.
Jason, you might want to look into doing an auto-logon first and then a running a "Lock Screen" script on startup. That way you will only need a password to get str8 to your already-loaded desktop. To get a preview of this just hit Ctrl+Alt+L after login. To get it setup, just enable auto-logon as per the directions above and then add "gnome-screensaver-command –lock" (no quotes) to your Startup Programs in the "System \ Preferences\ Sessions" menu.
Fantastic! This works a treat.
Thanks Matt.
Thanks, login window option have mysteriously disappeared from Administration menu in my computer. Looking for the shortcut ..
Once the screen has locked you have the option to switch user, which will take you back to the login screen. So if someone else or admin needs to log in, it can be done this way.
what about autologin as root? (please guys, no questions asked. if you know how, post, if not, SHUT UP!)
Thanks for some valuable hints.
What about a 100% command-line only equivalent?
If you run a server, the service is automatically running at the background no need to login.
Source:
http://ubuntuforums.org/showthread.php?t=472577
Thats all very well, but the latest ubuntu "karmic" is missing the said gdmsetup file… ARGHHH nothing like standards…
I am running Karmic and it still logs me on automatically (this is from an upgrade so it may have kept it installed) but it will no longer run the "Lock Screen" script on startup.