Article Title: Teach you how to omit a password in Linux. Linux is a technology channel of the IT lab in China. Some basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open-source systems, such as Linux, which omit passwords, are absolutely not recommended, but cannot be completed, linux skips the password, which poses a great threat to system security. Beginners can try this method on their own test machines. It helps beginners better understand the Linux system.
1. Password verification omitted Simply change root: x: 0: 0: root:/bin/bash in/etc/passwd to root: 0: 0: root:/root: /bin/bash, you can remove the x in it, so that the root user does not need a password. The same applies to other users.
2. the user name is omitted. (1) Modify/etc/inittab
The following configurations are available in inittab:
1: 2345: respawn:/sbin/agetty tty1 9600
2: 2345: respawn:/sbin/agetty tty2 9600
3: 2345: respawn:/sbin/agetty tty3 9600
4: 2345: respawn:/sbin/agetty tty4 9600
5: 2345: respawn:/sbin/agetty tty5 9600
6: 2345: respawn:/sbin/agetty tty6 9600
Indicates that the system can have six consoles, and ALT + (F1 ~ F6. While/sbin/agetty is a login verification program. When it is executed, the user is prompted to enter the user name and password, and then start a specified shell (specified in the passwd file ).
Therefore, we only need to modify it to not execute agettty, but to execute a script compiled by ourselves, we can skip the user name and password input. Modify as follows:
1: 2345: respawn:/root/logintest tty1 9600 (graphic interface is 5, to be tested)
Here I place a test script in/root/, so that the script will be executed when the system starts. The script content:
#! /Bin/sh
/Bin/login-f root (set as executable, to be tested)
The script actually executes the login of a root user. If you have other requirements, you can add them to the script.
In this way, we have completed some lazy operations to make Linux omit password input.
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