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.