How To Enable Automatic Logon In Ubuntu And Kubuntu

28

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.

April 3, 2010

bullshit talker @ 8:26 am #

arrgh.. i've tried thousand things to fucking disable the password check. my first hassle started when i had capslock on when changing the password. then it asks password everywhere and you don't know if it's the old or the new, caps lock on or off. i try to change it to lower case but it's too similar. or if i want it to have it short like 123 it's too short. i hate this bullshit that i can't modify my own system! oh yeah running that gksu /usr/sbin/gdmsetup won't work, nothing happens

bullshit talker @ 8:33 am #

so now i have how many different passwords to different things. pc logs in with old, system changes require new password with caps on. where do i fail, or is it Ubuntu that fails?

April 27, 2010

Reji @ 8:59 pm #

In my ubuntu even if I dont enter the password it login as a guest if I press the ENTER key. How to disable it?

May 16, 2010

John @ 1:00 pm #

it's been a while since i put away my Ubuntu machine and I realized I forgot the user name and password.

I don't mind creating a new user name, not being able to get into the original folders.

How can I do this? The screen I get is to enter user name and password, which does not do any good for me now.

June 27, 2010

nino @ 12:35 am #

Hahaha… that's f******* how free stuff work !!! You waste most of your time searching forums to do simple tasks that can be done in seconds with Windows.. maaan, u never know the value of windows till you install this s***@bullshit talker:

August 7, 2010

gare @ 8:56 am #

Thanks for posting this tip! Very helpful.

Worked great on Karmic.

September 8, 2010

brad972 @ 2:51 am #

Works like it should. Thanks for the input.

September 16, 2010

Lars @ 4:23 pm #

Thanks, this helped us with a server that needed to run certain processes whenever the machine got rebooted, without manual intervention. Saved our bacon!

January 8, 2011

Qwady @ 3:59 am #

In Ubuntu 8, the Login Window Preferences can be found mouseways in System > Administration. Go to Login Window, thet to the Security tab etc. as above.

Good Luck!

January 17, 2011

dean @ 10:29 am #

in ubuntu 10.04
alt+F2
gdmsetup
unlock
login as xxxxx automatically

you're there.

March 29, 2011

Derron @ 9:16 am #

It is really easy now… Applications… System… Login Screen…

Ubuntu keeps getting better and better.. watch out windows

Leave a Comment

Fields marked by an asterisk (*) are required.

Subscribe without commenting