How to Set automatic login in Linux

Source: Internet
Author: User
How to Set automatic Linux Login-general Linux technology-Linux technology and application information. For more information, see the following. Method 1:
1. Set
Using the GNOME Display Manager, you can set its configuration file/etc/TPD/custom. conf to enable automatic account logon.
The setting method is as follows:
Add the following content to the/etc/TPD/custom. conf file:
[Daemon]
AutomaticLogin = username
AutomaticLoginEnable = True
Here, username is the user name for automatic login.
Note: username cannot be root, which means Automatic root Login cannot be implemented.
2. Set preofdm
In the last line of the/etc/inittab file, this line of command is used to start X Windows, and/etc/X11/preofdm is the specific script to start X Windows.
Add the command to start X Windows in/etc/X11/preofdm and exit.
/Usr/bin/startx
Exit 1
Note:
(1) The two lines of code must be
[-N "$ preferred"] & exec $ preferred "$ @">/dev/null 2> & 1(2) This method automatically logs in as root because it is root when running to/etc/X11/preofdm.
3. Start X Windows in rc. local
Add the command to start X Windows in/etc/rc. local.
/Usr/bin/startx
Note: This method is automatically logged on as root because it is root when running to/etc/rc. local.
After completing the preceding operations, you can automatically log on to Xwindow.

Method 2:
First, configure the automatic logon command line interface
Change/etc/inittab to 1: 2345: respawn:/sbin/mingetty tty1 to 1: 2345: respawn:/sbin/mingetty tty2
-- Autologin aixi
Then change/etc/inittab to start to the character interface: id: 3: initdefault
# Init q make the configuration take effect
In this way, the command line interface can be automatically started after the instance is started. If you want to automatically start the instance to the graphic interface, you can modify the settings as follows:
Add the command to start X Windows in/etc/rc. local.
/Usr/bin/startx
In this way, you can automatically start to the command line, and the command line automatically runs startx to start the graphic interface. This is the simplest way. The above test is successful in Centos5.7.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.