How to make your linux system omit the user name and password

Source: Internet
Author: User
For details about how to make your linux system omit the username and password-Linux general technology-Linux technology and application information, see the following. It is difficult to enter the system by entering the user name and password when performing livecd. Therefore, we plan to skip these two steps.

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

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

The script actually executes the login of a root user. If you have other requirements, you can add them to the script.

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.