Set the login user and user password
In the/etc/inittab file, the contents are as follows
#first: Run the System script file
:: Sysinit:/etc/init.d/rcs
#::askfirst:-/bin/sh
:: Sysinit:-/bin/login
:: Ctrlaltdel:-/sbin/reboot
#umount all FileSystem
:: Shutdown:/bin/umount-a-R
#restart Init process
:: Restart:/sbin/init
Add a note, the fourth item is to set the login interface, using the login program in BusyBox. I commented out the third item and added a fourth item.
Create a passwd file and shadow file under the/etc/directory
The contents of the passwd file are
Root:x:0:0:root:/:/bin/sh
The first paragraph indicates the login user name, the second paragraph if x indicates that the password is in shadow, is not visible. The third paragraph represents the current user's UID level, the general root Super User UID is 0, the highest level, it is best to set the UID level of other users to 0. The fourth paragraph does not say, in detail forget, can search online, the fifth paragraph indicates the full name of the login name, is not very important, can represent the user's address, etc. The sixth paragraph indicates the directory after the default login, and the seventh paragraph represents the script executed after login. Arm Linux is/bin/sh instead of/bin/bash.
The contents of the shadow file are
root:wdfdfqwe:17226::::
The first paragraph indicates the user name of the login
The second paragraph represents the ciphertext password.
Set User password
passwd Root
After entering the user's password, then in the shadow will generate the ciphertext password, you can not know the meaning of the secret text password, the shadow file will be stored in the ciphertext password into the folder to make the root file system, and then burn so that you do not have to set the password each time.
After rebooting the system, after root login, reboot cannot be used, at this time, use reboot-f can be restarted.
After setting the login interface and password, if using Telent login will also need to enter the login name and password, there is the effect of protecting the system. Password if you forget, only in the folder form of the root file system, the shadow file in the ciphertext password to empty, so that no password, and then re-burn, the system starts, directly enter the login name can be logged into the system, you can re-use the passwd Root re-set the password for the root user, after the successful setting in the shadow file and generate the password corresponding ciphertext password, this shadow file in this user corresponding password copy to the folder in the form of the root file system, re-create the file system re-burn.
If you do not want to login interface, do not enter the login name and password every time, only need to comment out the fourth item in the Ininttab file, the third comment opens.
This article is from the "Whylinux" blog, make sure to keep this source http://whylinux.blog.51cto.com/10900429/1904872
ARM Linux Sets login user and user password, and reboot cannot restart after login to root