id: cannot find name for user ID xxx

root用戶登錄顯示正常但以普通用戶登錄時或執行whoami時報錯,命令:su pd2030(或者whoami)。

報類似如下錯誤:

id: cannot find name for user ID 1000
id: cannot find name for group ID 1000
id: cannot find name for user ID 1000

然後原本應顯示用戶名的位置被“I have no name!”代替。

原因:

/etc/passwd和/etc/group other權限太小

解決:

修改權限這兩個文件的other權限:

chmod o+r /etc/passwd
chmod o+r /etc/group 

 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章