solaris 10 root忘記密碼的解決方案

來源:互聯網
上載者:User
我的root本來是沒有密碼的。在控制台用root登陸了,執行了sys-unconfig,重新設定了一下系統資訊。密碼依然留空。(sys-unconfig會清除所有的設定資訊,包括root密碼,奇怪的是卻不會刪除其它使用者的密碼。)再登陸時,突然要我輸入密碼。
上哪兒去偷呢?想哭~

查看soliaris的文檔817–1985–15 SystemAdministration Guide:Basic Administration 的Managing UserAccounts and Groups
(Overview)部分,裡面有說明:

Password information is stored as follows:
· In the passwd file when you are using NIS or NIS+
· In the /etc/shadow file when you are using /etc files
· In the people container when you are using LDAP

The fields in the shadow file are separated by colons and contain the following information:
username:password:lastchg:min:max:warn:inactive:expire
password Might contain the one of following entries:
· A13-character encrypted user password
· The string *LK*, which indicates an inaccessible account
· The string NP, which indicates no password for the account

也就是說,空密碼的root,在/etc/shadow中應該有如下資訊:
root:NP:6445::::::
我看了我的shadow檔案
#vi /etc/shadow
root::6445::::::

按照solaris10在其文檔817-1758 System Administration Guide: Advanced Administration裡提供的的解決辦法。

What to Do if You Forgot Root Password

If you forget the root password and you cannot log into the system, you will have to:

    * Stop the system by using the keyboard stop sequence.
    * Boot from a boot or install server or from a local CD-ROM.
    * Mount the root (/) file system.
    * Remove the root password from the /etc/shadow file.
    * Reboot the system.
    * Log in and set root's password.

還描述得甚為詳細:

# vi shadow
(Remove root's encrypted password string)

這裡為空白就沒有密碼了,然而登陸不上卻是事實。改成root:NP:6445::::::(先用命令"chmod +rw shadow"將檔案改為可讀寫)。還要問我要密碼。

又想了一個辦法。我還有一個建立的帳戶cracker。設了密碼為401448ff。其在shadow中的資訊為:
cracker:y5mLgGTOxxDdM:13723::::::
將其密碼部分複製到root的密碼部分
root:y5mLgGTOxxDdM:6445::::::
重啟,用401448ff成功登陸!

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.