En:HOWTO: Setting Up Autologin

From Sabayon Wiki
Jump to: navigation, search
i18n: en it tr
Stop.png
Never ever enable Autologin for root!

This Howto will help you setting up your Autologin, so that you will need no more to authenticate in a login prompt.
Be aware that this is a security risk, since anyone will be able to get access to your computer with no need of any password or authorization, this is intended just for home computers.


Setting Up Autologin in KDE4

Some users reported the inability to set up the Autologin from within the KDE Control Center, they reported the page to be grayed out, with the message:
"There is no login dialog in themed mode"
If it is not your case, then setting the Autologin with the Control Center is the recommended way, otherwise proceed with the Howto.


1. Become root with the su command in your favourite console application, for example "Konsole".

su

Type in your root password.

2. Make sure that the Sabayon Media Centre init script is not in a system runlevel:

rc-update del sabayon-mce boot
rc-update del sabayon-mce default

3. Open up the kdmrc file with your favourite editor, we will use kwrite in this example.
The kdmrc file is usually located in: /usr/kde/4.2/share/config/kdm/kdmrc

If it is not there, try to find it with the locate command:

locate kdmrc

or the find command:

find / -name kdmrc

In this example we will suppose that it is located at /usr/kde/4.2/share/config/kdm/kdmrc.

Now we will open it up with kwrite:

kwrite /usr/kde/4.2/share/config/kdm/kdmrc

Notice that KDE4 may require the full path to "kwrite", in this case you will receive an error message:

# kwrite
bash: kwrite: command not found

You could use "nano" instead:

nano /usr/kde/4.2/share/config/kdm/kdmrc

or launch "kwrite" using "kdesu" from your normal user account, not the root user account:

kdesu kwrite /usr/kde/4.2/share/config/kdm/kdmrc

4. Now we are going to setup our preferences, we can notice a section in this file with the Autologin preferences; these lines are commented.
Commented lines are marked with a '#', and are ignored; if a preference is commented, it is going to be used the default configuration for that setting.

The relevant lines for our purpose are:

#AutoLoginEnable=true

and

#AutoLoginUser=fred

We want them to enable the Autologin with our default user, assume that the default user we want to Autologin is micia.
We set #AutoLoginEnable=true to:

AutoLoginEnable=true

So that the preference is no more ignored, and we set #AutoLoginUser=fred to:

AutoLoginUser=micia

This is it, save the file, reboot, and see if it worked.

Setting Up Autologin for Gnome (GDM)

This is an easy one, just use gdmsetup to configure your preferences.
You have to run it as root, so, as usual:


1. Open up your favourite console application, for example gnome-terminal and type:

su

Now type in your root password.

2. Make sure that the Sabayon Media Centre init script is not in a system runlevel:

rc-update del sabayon-mce boot
rc-update del sabayon-mce default

3. Run gdmsetup:

gdmsetup

And enable Automatic Login for your user.


Someone reported that gdmsetup was not in their root $PATH variable, if this is your case executing gdmsetup should output something like:

il-padre-mobile micia # gdmsetup
bash: gdmsetup: command not found

You will need to find the gdmsetup executable, with locate or find as above, for example using find:

find / -name gdmsetup

Suppose that the result is:

# find / -name gdmsetup
/usr/sbin/gdmsetup
/etc/security/console.apps/gdmsetup
/etc/pam.d/gdmsetup

Obviously the one which interests us is /usr/sbin/gdmsetup, we then execute it explicitly with:

/usr/sbin/gdmsetup


This should work for the GDM Display Manager.
I hope this will help someone, good luck!