CentOS / RHEL 6 – AutoLogin

If your linux is essentially a single user system and you don’t have to worry about anyone else accessing your local console, here’s how to enable it:

Edit /etc/gdm/custom.conf to add the following two lines in the [daemon] section:

[daemon]
AutomaticLoginEnable=true
AutomaticLogin=username

Cheers,
- Sudhaker

This entry was posted in Uncategorized. Bookmark the permalink.

11 Responses to CentOS / RHEL 6 – AutoLogin

  1. Peter says:

    You just need to type “true” with a capital “T”, i.e.:

    [daemon]
    AutomaticLoginEnable=True
    AutomaticLogin=username

  2. allan says:

    Thanks for that tip. The user/manager of CentOS doesn’t provide that functionality.

  3. Steve says:

    Worked great for me with CentOS 6, thanks. I was expecting to find the “Login Screen” option under System > Administration like with previous versions.

  4. nixdog says:

    for text based autologin in RHEL6, edit /etc/init/tty.conf
    where: exec /sbin/mingetty $TTY
    chgto: exec /sbin/mingetty –autlogin username $TTY

  5. Wes Jones says:

    The problem I’m seeing with the text based way is that ALL tty’s do an auto login and any script made to start, all start at the same time. Thus causing things to crash and lock up on me. How can I do this with only tty1?

  6. Ryan says:

    Thanks for listing this! I really appreciate it. This worked for me on my Scientific Linux 6.1 install.

  7. prasath says:

    This setup not working in redhat 6.

  8. Brett Gardner says:

    I got it to work by doing

    /etc/init/start-ttys.conf

    #
    # This service starts the configured number of gettys.

    start on stopped rc RUNLEVEL=[2345]

    env ACTIVE_CONSOLES=/dev/tty[1-6]
    env X_TTY=/dev/tty1
    env TTY_AUTO_LOGIN=/dev/tty1
    env AUTO_LOGIN_USER=mythtv
    task
    script
      . /etc/sysconfig/init
      for tty in $(echo $ACTIVE_CONSOLES) ; do
        [ "$RUNLEVEL" = "5" -a "$tty" = "$X_TTY" ] && continue
        if [ "$TTY_AUTO_LOGIN" = "$tty" ]
        then
          initctl start tty-auto-login AUTO_LOGIN_USER=$AUTO_LOGIN_USER TTY=$tty
        else
          initctl start tty TTY=$tty
        fi
      done
    end script

    and

    /etc/init/tty-auto-login.conf.
    Note this filename matches the second argument to initctl in /etc/init/start-ttys.conf above.

    # tty - getty
    #
    # This service maintains a getty on the specified device.

    stop on runlevel [S016]

    respawn
    instance $TTY
    instance $AUTO_LOGIN_USER
    exec /sbin/mingetty --autologin=$AUTO_LOGIN_USER $TTY
  9. fack says:

    or as timed login

    [daemon]
    TimedLoginEnable=true
    TimedLogin=centoslive
    TimedLoginDelay=10

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

What is 43 + 32 ?
Please leave these two fields as-is:
IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)