passwd: User not known to the underlying authentication——以解決

來源:互聯網
上載者:User


passwd: User not known to the underlying authentication——以解決

在做老師布置的練習的時候,嘗試修改使用者的密碼,結果出現了如下錯誤:passwd:User not known to the underlying authentication。通過上網尋找資料後得知pwck,pwconv可以幫我解決這個問題。所以為了記住這種方法,將其記錄下來與大家分享。

首先說明一下,我曾多次手動添加過賬戶,在/etc/passwd、/etc/shadow裡面的資訊比較亂,有些資訊想要手動刪除卻怎麼也刪不掉,於是才引發了我後來修改密碼時出錯的原因。下面主要介紹一下如何解決這種問題。

其次,我們先熟悉兩個linux下的命令,一個是pwck命令,一個是pwconv命令:

pwck是驗證系統認證資訊的完整性,檢查 /etc/passwd、/etc/ shadow中所有條目的格式是否正確、每個欄位的資訊是否有效。系統會提示使用者刪除格式不正確的條目和其他不可糾正的錯誤;pwconv會根據根據/etc/passwd建立/etc/shadow,這樣可以有效系統管理使用者的帳號資訊。然後依次執行一下命令即可。

[root@taumy ~]# sudo /usr/sbin/pwck

使用者 adm:目錄 /var/adm 不存在

使用者 news:目錄 /etc/news 不存在

使用者 uucp:目錄 /var/spool/uucp 不存在

使用者 gopher:目錄 /var/gopher 不存在

使用者 ftp:目錄 /var/ftp 不存在

使用者 pcap:目錄 /var/arpwatch 不存在

使用者 avahi-autoipd:目錄 /var/lib/avahi-autoipd 不存在

使用者 sabayon:目錄 /home/sabayon 不存在

無效的密碼檔案項

delete line ''? yes

使用者 mysql:目錄 /home/mysql 不存在

no matching password file entry in /etc/passwd

delete line 'u1:!!:15970:0:99999:7:::'? yes

pwck:檔案已被更新

[root@taumy ~]# sudo /usr/sbin/pwconv

[root@taumy ~]# passwd nomas

Changing password for user nomas.

New UNIX password:

BAD PASSWORD: it is too simplistic/systematic

Retype new UNIX password:

passwd: all authentication tokens updated successfully

用另一種方法修改密碼同樣得到你想要的結果:

[root@taumy ~]# echo "abc123" | passwd --stdin nomas

Changing password for user nomas.

passwd: all authentication tokens updated successfully.




本文出自 “閑雲野鶴” 部落格,請務必保留此出處http://taumycheung.blog.51cto.com/7778179/1302941

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.