How To Enable Automatic Logon In Ubuntu And Kubuntu

17

ubuntulogo.jpgI'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.

ubuntuautologon1.png

 

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.

ubuntuautologon3.png

 

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.

ubuntuautologon2.png

 

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.

Comments on How To Enable Automatic Logon In Ubuntu And Kubuntu Leave a Comment

December 11, 2007

simon @ 9:31 pm #

these instructions are not useful to Kubuntu users, as it utilises a gnome specific program…

February 7, 2008

Dick Knight @ 4:06 pm #

Thank you for this site. I used your directions for auto login in ubuntu. GOOD JOB!!!!!!

May 13, 2008

teddyhcraig @ 6:46 pm #

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.

June 19, 2008

What about Kubuntu?

September 15, 2008

Jason @ 12:33 pm #

Is there any way of logging in a user but still asking for the password?

Jason @ 1:13 pm #

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.

November 9, 2008

Matt @ 4:14 am #

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.

November 11, 2008

Jason @ 3:09 am #

Fantastic! This works a treat.

Thanks Matt.

April 8, 2009

Thanks @ 2:33 pm #

Thanks, login window option have mysteriously disappeared from Administration menu in my computer. Looking for the shortcut ..

April 14, 2009

Gilbert @ 1:05 am #

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.

May 10, 2009

just me @ 6:12 pm #

what about autologin as root? (please guys, no questions asked. if you know how, post, if not, SHUT UP!)

June 7, 2009

Eric @ 1:58 pm #

Thanks for some valuable hints.

What about a 100% command-line only equivalent?

November 19, 2009

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

February 28, 2010

Stevvie @ 11:13 am #

Thats all very well, but the latest ubuntu "karmic" is missing the said gdmsetup file… ARGHHH nothing like standards…

Gilbert @ 1:09 pm #

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.

Leave a Comment

Fields marked by an asterisk (*) are required.

Subscribe without commenting