Linux set up automatic landing method

method one:

1. Setting up GDM

GDM is the GNOME Display Manager, by setting its profile /etc/gdm/custom.conf account can be set to automatically log in.

Set as follows:

Add the following in /etc/gdm/custom.conf file

[daemon]

AutomaticLogin=username

AutomaticLoginEnable=True

Which, username to automatically log the user name.

Description: username is not root, it can not be said of the automatic landing root.

2, set prefdm

Which, / etc / inittab file the last line, the role of the command line is to start X Windows, and the / etc / X11 / prefdm is the concrete implementation of the X Windows startup script.

Add to start X Windows commands in / etc / X11 / prefdm and exit.

/usr/bin/startx

exit 1

Description:

(1) must be in two lines

[ -n "$preferred" ] && exec $preferred "$@" >/dev/null 2>&1 </dev/null

Before the code.

(2) the method automatically logged in as root, because when you run the / etc / X11 / prefdm, is the root.

3, X Windows to start in the rc.local

In /etc/rc.local to add the command to start the X Windows

/usr/bin/startx

Note: This method is automatically logged in as root, because when you run into /etc/rc.local, is the root.

Above finished above operations can be achieved Xwindow automatic login

Method Two:

First configure automatic login command line interface

Modify / etc / inittab to 1: 2345: respawn: / Change sbin / mingetty tty1 to 1: 2345: respawn: / sbin / mingetty tty2 --autologin aixi

Then the / etc / inittab to start to modify the character-based interface: id: 3: initdefault

#init q validate the configuration

This will boot automatically start to the command line interface, if you want to automatically start a graphical interface, in fact, modified on the basis of the following:

In /etc/rc.local to add the command to start the X Windows

/usr/bin/startx

This will automatically start to the command line, the command line and automatically run startx to start the graphical interface. This is the simplest way. In the above versions Centos5.7 test.

Guess you like

Origin www.cnblogs.com/fanweisheng/p/11109456.html