2015年8月23日 星期日

Cent OS 7 更改 Root 密碼

Reset root password on RHEL7

1. Start system and press any key to interrupt the boot sequence

2. Press the "e" key to enter the edit mode

3. Go down to the "linux16" or "linuxefi" line using the arrow keys

5. Remove the "rhgb" and "quiet" parameters, and add the "init=/bin/sh" option
#"quiet" 螢幕會顯示輸入文字

6. Press Ctrl + X to boot in the sh shell

7. /usr/sbin/load_policy -i

8. mount -o remount, rw / (remount / to read/write)

9. passwd (change root passwd)

# 10. touch /.autorelabel(make sure SELinux context is restored properly)
  recommand to use step 7.

11. exec /sbin/reboot
(因5非正常方式開機,故正規重開高機率失敗,須強制重開)



Reference:

https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/sec-Terminal_Menu_Editing_During_Boot.html#sec-Recovering_Root_Password



http://linoxide.com/linux-how-to/reset-forgotten-root-password-rhel-centos-7/

沒有留言:

張貼留言