Red Hat 7 Two ways to change the root password
Method One:
1. Restart the system and press "E"
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/7F/2B/wKiom1cVpPjD9TXYAABWpbuZXsU479.jpg "title=" 1.jpg " alt= "Wkiom1cvppjd9txyaabwpbuzxsu479.jpg"/>
2. At the end of the linux16 line, add the following information and press "Ctrl+x" to start
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/7F/2B/wKiom1cVpQ2QkzBCAAC0LrTiN0w429.jpg "title=" 2.jpg " alt= "Wkiom1cvpq2qkzbcaac0lrtin0w429.jpg"/>
3. Re-mount the file system and change the root directory
650) this.width=650; "src=" http://s2.51cto.com/wyfs02/M01/7F/2A/wKiom1cVo4XhC-KAAAAct3RULf4548.jpg "title=" 3.jpg " alt= "Wkiom1cvo4xhc-kaaaact3rulf4548.jpg"/>
4. Change the root password
650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M02/7F/2A/wKiom1cVo72TRswcAABEJk7ja4U517.jpg "title=" 4.jpg " alt= "Wkiom1cvo72trswcaabejk7ja4u517.jpg"/>
5. Create related files in the root directory (for re-tagging selinux environment values)
650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M01/7F/2A/wKiom1cVpAHhNck9AAALgQK3D1c909.jpg "title=" 5.jpg " alt= "Wkiom1cvpahhnck9aaalgqk3d1c909.jpg"/>
6. Exit, the system will restart
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/7F/28/wKioL1cVpRzi8dIJAAAS2LHkf7Q917.jpg "title=" 6.jpg " alt= "Wkiol1cvprzi8dijaaas2lhkf7q917.jpg"/>
Method Two:
1. Restart the system and press "E"
650) this.width=650; "src=" http://s4.51cto.com/wyfs02/M02/7F/28/wKioL1cVpf3z5ZG_AABWpbuZXsU057.jpg "title=" 1.jpg " alt= "Wkiol1cvpf3z5zg_aabwpbuzxsu057.jpg"/>
2. The "RHGB quiet" in this line of linux16 is modified to "init=/bin/sh", which replaces the default daemon process with the shell and then presses "ctrl+x" to start
650) this.width=650; "src=" http://s2.51cto.com/wyfs02/M01/7F/2B/wKiom1cVponD4GFfAABhzsSGhSI656.jpg "title=" 7.jpg " alt= "Wkiom1cvpond4gffaabhzssghsi656.jpg"/>
3. Mount the file system as writable mode, because the root directory load permission is RO, so you need to re-mount the permissions to RW
650) this.width=650; "src=" http://s5.51cto.com/wyfs02/M01/7F/2B/wKiom1cVp6uiZq9kAAALiwm4LO4903.jpg "title=" 8.jpg " alt= "Wkiom1cvp6uizq9kaaaliwm4lo4903.jpg"/>
4. Change the root password
650) this.width=650; "src=" http://s4.51cto.com/wyfs02/M00/7F/2B/wKiom1cVp7-ywQu8AABC-G8BdvE972.jpg "title=" 9.jpg " alt= "Wkiom1cvp7-ywqu8aabc-g8bdve972.jpg"/>
5. Create related files in the root directory (for re-tagging selinux environment values)
650) this.width=650; "src=" http://s2.51cto.com/wyfs02/M01/7F/29/wKioL1cVqLbgoopQAAALgShAhg8635.jpg "title=" 10.jpg "alt=" Wkiol1cvqlbgoopqaaalgshahg8635.jpg "/>
6. Run the command "Exec/sbin/init" to start the system normally
650) this.width=650; "src=" http://s4.51cto.com/wyfs02/M02/7F/2B/wKiom1cVqRaShiKdAAAKk2zjpws547.jpg "title=" 11.jpg "alt=" Wkiom1cvqrashikdaaakk2zjpws547.jpg "/>
Linux Red Hat 7 forgot root password