Enable Automatic Linux logon in Command Line Mode

Source: Internet
Author: User

Linux Login is mainly controlled by two files./usr/sbin/Getty gets the user name and checks whether the user name exists, then, pass the user name to/usr/bin/login to obtain the user's password and check whether the password is correct.

Therefore, to achieve automatic Linux Login, you need to change these two files.
1. The main functions of Getty are as follows:
1) Open the specified tty;
2) prompt the user to log on (LOGIN :);
3) obtain the logon username;
4) Pass the username to the LOGIN command

2. The main functions implemented by login are:
1) check whether the vehicle is a Super User first;
2) prompt the user to enter the password (implemented by getpass );
3) Check the password and quiet logon;
4) set the login user ID and group ID, and set the corresponding environment variables.

3. Download the source code package of util-linux. the login and Getty commands are generated here.
1) modify the code for obtaining the LOGNAME from the agetty. c file.
While (LOGNAME = get_logname (& options, & chardata, & termio) = 0)
Next_speed (& termio, & options );
Comment out the above two rows and add:
LOGNAME = "your count name"; // enter your account name

2) modify the login. c file:
If passwd_req is a switch for password verification, disable:
Passwd_req = 0;
Comment out the following rows that assign values to passwd_req:
If (fflag & (getuid () = 0 ))
Passwd_req = 0;
Else
Passwd_req = 1;
All comments above.

3) then./configure, and make in login-utils. Do not make install.
4) back up the system's login and Getty, copy the compiled login and agetty, and change agetty to Getty.

4. Then reboot, and your system will directly enter the system.

 

This is the implementation method of the command line startup system. Linux is a Ubuntu system, and desktop has nothing to say, just set it in startup.

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.