Rhel/centos Automatic login in plain text mode

Source: Internet
Author: User

Linux system startup logon process

The entire process from boot to login for a Linux system is roughly as follows:

1> Loading BIOS information: Includes hardware information such as cpu/graphics/memory/hard disk/NIC, device boot sequence, clock information, etc.

2> According to the boot sequence information of the BIOS, execute it sequentially until the boot file is found

3> boot Loader: Load boot boot file

4> Load kernel, complete the establishment of Linux core environment

5> Executes the/sbin/init program, reads the configuration file/etc/inittab, sets the run level, such as levels 3 (this is the first program that the system executes after loading the kernel)

6> init program execution script/etc/rc.d/rc.sysinit: Set PATH variable, set network configuration, start swap partition, set/PROC, etc.

7> loading kernel modules according to/etc/modules.conf files or files in/ETC/MODULES.D directory

8> Select the operating level is 3, start the/etc/rc.d/rc.3.d/directory script program, is often said to start the service

9> Executing/etc/rc.local Script program

10> executes the/sbin/mingetty program, reads the user list, and translates the user name into the parameters of the/bin/login program call

11> Execute/bin/login program, wait for input and verify user name and password

At this point, it is clear that in the LEVEL3 mode, to achieve automatic login, you need to change in the 10th and 11 two steps.

• First, recompile the build/sbin/mingetty program

1. View the package and version of the current workstation's/sbin/mingetty (for example: mingetty-1.08-5.el6.x86_64)

Rpm-qf/sbin/mingetty

2. According to the current version, go to the website http://download.chinaunix.net/, search the keyword "Mingetty", and then download the corresponding source software package (due to the lack of resources related to the site, Therefore download mingetty-1.07-5.src.rpm This version, can also be downloaded directly under the workstation via wget command)

wget http://down1.chinaunix.net/distfiles/mingetty-1.07-5.src.rpm

3. Move the downloaded/uploaded source package to the/OPT/RH directory and unzip it (develop a classification placement and good management habits)

MV Mingetty-1.07-5.src.rpm/opt/rhcd/opt/rhrpm2cpio mingetty-1.07-5.src.rpm |CPIO-DIVTAR-ZXVF mingetty-1.07.tar.gz

4. Modify the code in the file mingetty-1.07/mingetty.c (the user who set up automatic logon is xxx, and the user must exist):

5. Compile build Mingetty (compile process takes time, do not interrupt)

cd/opt/rh/mingetty-1.07/&& Make

6. Mingetty mandatory overwrite of the file created by make to the/sbin directory, the Mingetty source changes are complete.

1 CP -f/opt/rh/mingetty-1.07/mingetty/sbin

• Then, recompile the build/bin/login program

1. View the package and version of the current workstation's/bin/login (for example: util-linux-ng-2.17.2-12.14.el6.x86_64)

1 rpm-qf/bin/login


2. According to the current version, go to the website http://download.chinaunix.net/, search for the keyword "Util-linux", and then download the corresponding source software package (based on the current workstation version, Recommended Downloads: UTIL-LINUX-NG-2.17.2.TAR.BZ2)

1 cd/opt/RH2wget http://down1.chinaunix.net/distfiles/ UTIL-LINUX-NG-2.17.2.TAR.BZ2


3. Unzip the downloaded/uploaded source software package

1 tar -jxvf util-linux-ng-2.17. 2. tar. bz2

4. Modify the code in the file util-linux-ng-2.17.2/login-utils/login.c

5. Install the GCC compiler before compiling the build login (the compilation process takes time, do not interrupt)

1 Yum Install GCC 2 GCC Login login. C.. /lib/setproctitle.c checktty.c-wall-lcrypt-i. /include/

6. The generated file login is forced to overwrite the/bin directory, so that the login source changes are completed.

1 CP login /bin/login

7. Finally, you can restart the machine.

Rhel/centos Automatic login in plain text mode

Related Article

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.