ºìÁªLinuxÃÅ»§
Linux°ïÖú

LinuxÏÂrootÐÞ¸ÄÃÜÂ뱨´í½â¾ö·½°¸

·¢²¼Ê±¼ä:2017-12-09 09:16:41À´Ô´:ºìÁª×÷Õß:Ronny
½ñÌì×¼±¸ÐÞ¸ÄLinuxϵͳµÄrootÓû§ÃÜÂëʱ£¬Ö´ÐÐpasswd root£¬³öÏÖÁËÒÔÏÂÇé¿ö£¬ÐÞ¸ÄÃÜÂëʧ°Ü£º

# passwd root
Changing password for user root.
New password:
Retype new password:
passwd: Authentication token manipulation error
µ½ÍøÉÏËÑÁËÏ£¬ÓеÄ˵ÊÇÒòΪinodesÓÃÍ꣬Ҳ¾ÍÊǸù·ÖÇøÂúÁËÒýÆðµÄ£¬µ«Ö´ÐÐdf -i²¢·ÇÕÒ¸öÔ­Òò£º

# df -i
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/sda2 6406144 58534 6347610 1% /
tmpfs 8242797 2 8242795 1% /dev/shm
¼ÌÐøÕҴ𰸣¬°´ÕÕÍøÉϵݸÀý¼ì²éÓû§ÃÜÂëÏà¹ØµÄϵͳÎļþ/etc/passwdºÍ/etc/shadow£¬·¢ÏÖÕâÁ½¸öÎļþȨÏÞÓÐiÑ¡Ï²éѯ½á¹ûÈçÏ£º

# lsattr /etc/passwd
---i-----e- /etc/passwd
# lsattr /etc/shadow
---i-----e- /etc/shadow
±¸×¢£ºÔÚLinuxϵͳÀÎļþÓÐiÑ¡ÏîÔò±íʾ²»µÃ¶ÔÆä×öÈκεÄÐ޸ģ¬ÕâÒ²¾Íµ¼ÖÂÁËÐÞ¸ÄÃÜÂëʧ°Ü¡£

Òª½â¾ö¸ÃÎÊÌ⣬ÔòÐèÒªÖ´ÐÐchattr -iÃüÁ½«ÒÔÉÏÁ½¸öÎļþiȨÏÞ³·Ïúµô

# chattr -i /etc/passwd
# chattr -i /etc/shadow
# lsattr /etc/passwd
---------e- /etc/passwd
# lsattr /etc/shadow
---------e- /etc/shadow
È»ºóÔÙÖ´ÐÐpasswdÐÞ¸ÄÃÜÂ룬

# passwd
Changing password for user root.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
ÐÞ¸ÄÍêÃÜÂëºó£¬ÎªÁË°²È«Æð¼û£¬¿ÉÒÔÖ´ÐÐchattr +iΪÓû§ÃÜÂëϵͳÎļþÔö¼ÓiȨÏÞ

# chattr +i /etc/passwd
# chattr +i /etc/shadow
# lsattr /etc/passwd
---i-----e- /etc/passwd
# lsattr /etc/shadow
---i-----e- /etc/shadow
±¾ÎÄתÔØ×Ô£ºhttp://www.linuxprobe.com/linux-root-passwd.html

Ãâ·ÑÌṩ×îÐÂLinux¼¼Êõ½Ì³ÌÊé¼®£¬Îª¿ªÔ´¼¼Êõ°®ºÃÕßŬÁ¦×öµÃ¸ü¶à¸üºÃ£¬¿ªÔ´Õ¾µã£ºhttp://www.linuxprobe.com/
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 1 ÌõÆÀÂÛ

  1. Ronny ÓÚ 2017-12-09 09:16:55·¢±í:

    LinuxÏÂrootÐÞ¸ÄÃÜÂ뱨´í½â¾ö·½°¸