Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to skip input username and password when booting in Linux

Shulou Source: shulou.com Published: 2022-06-02 10:42:16 09月20日 Update

How to skip user name and password input in Linux? I believe many inexperienced people are at a loss about this. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

Linux skips entering username and password when booting

Omit password authentication

Just change the root:x:0:0:root:/root:/bin/bash in / etc/passwd to root::0:0:root:/root:/bin/bash, which is to remove the x from it, so that root users don't need a password. The same goes for other users.

Omit the input user name

Modify / etc/inittab

In inittab, the configuration is as follows:

O0:12345:respawn:/sbin/getty-L 115200 ttyO0

We can skip the user name and password entry simply by modifying it to not execute gettty but to execute a script we wrote. Drop a script file log in the root directory (note the permissions of the script file, I set it to 777 here), and modify it as follows:

O0:12345:respawn:/log-L 115200 ttyO0

The log script file is as follows

#! / bin/sh

/ bin/login-f root

After reading the above, have you mastered how to skip entering the user name and password in Linux? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Tags: User password user name input script file content method more problem helpless for this no reason just for this that is skills permissions root directory Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Shulou Tech Info Microsoft NVidia Linux