Linux操作系统执行passwd命令重置密码失败
Last updated
2023-01-28 10:46:55
{"value":"> Linux\u64cd\u4f5c\u7cfb\u7edf\u6267\u884cpasswd\u547d\u4ee4\u91cd\u7f6e\u5bc6\u7801\u5931\u8d25\u63d0\u793a\uff1aAuthentication token manipulation error\n\n### \u95ee\u9898\u73b0\u8c61\n\nroot\u7528\u6237\u7528passwd\u547d\u4ee4\u4fee\u6539\u7ba1\u7406\u5458\u7528\u6237\u4ee5\u53ca\u666e\u901a\u7528\u6237\u7684\u5bc6\u7801\u65f6\u5931\u8d25\uff0c\u63d0\u793apasswd:Authentication token manipulation error\u3002\n\n\t[root@cdncloud ~] # passwd\n\tchanging password for user root .\n\tNew password :\n\tRetype new password : \n\tpasswd : Authentication token manipulation error\n\n### \u539f\u56e0\u5206\u6790\n\n\u51fa\u73b0\u8be5\u95ee\u9898\u901a\u5e38\u662f\u5bc6\u7801\u6587\u4ef6\u7684\u5c5e\u6027\u7684\u95ee\u9898\u5bfc\u81f4\uff0c\u4e5f\u6709\u53ef\u80fd\u662f\u6839\u76ee\u5f55\u7a7a\u95f4\u6ee1\u3002\n\n\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770b\u5b58\u653e\u7528\u6237\u548c\u5bc6\u7801\u7684\u6587\u4ef6\uff08\/etc\/passwd\u548c\/etc\/shadow\uff09\u5c5e\u6027\u3002\n\n\t[root@cdncloud ~]#lsattr \/etc\/passwd \/etc\/shadow\n\t----i--------e-- \/etc\/passwd\n\t----i--------e-- \/etc\/shadow\n\n\u5982\u4e0a\u6240\u793a\uff0c\/etc\/passwd\u548c\/etc\/shadow\u6587\u4ef6\u4e2d\u6709i\u5c5e\u6027\uff0c\"i\"\u7684\u6587\u4ef6\u5c5e\u6027\u8868\u793a\u8be5\u6587\u4ef6\u4e0d\u80fd\u4fee\u6539\uff1a\u5b83\u4e0d\u80fd\u88ab\u5220\u9664\u6216\u91cd\u547d\u540d\uff0c\u65e0\u6cd5\u4e3a\u6b64\u521b\u5efa\u4efb\u4f55\u94fe\u63a5\u6587\u4ef6\uff0c\u4e0d\u80fd\u5c06\u4efb\u4f55\u6570\u636e\u5199\u5165\u8be5\u6587\u4ef6\u3002\u53ea\u6709\u7ba1\u7406\u5458\u7528\u6237\u53ef\u4ee5\u8bbe\u7f6e\u6216\u6e05\u9664\u6b64\u5c5e\u6027\u3002\n\n### \u89e3\u51b3\u65b9\u6cd5\n\n\u7528chattr\u547d\u4ee4\u5c06i\u6743\u9650\u64a4\u9500\uff0c\u7136\u540e\u518d\u4fee\u6539\u5bc6\u7801\u3002\n\u5982\u679c\u6587\u4ef6\u5c5e\u6027\u4e3a\"i\"\uff0c\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u3002\n\n\t# chattr -i \/etc\/passwd \/etc\/shadow\n\n\u5982\u679c\u6587\u4ef6\u5c5e\u6027\u4e3a\"a\"\uff0c\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u3002\n\n\t# chattr -a \/etc\/passwd \/etc\/shadow\n\n\uff08\u53ef\u9009\uff09\u5982\u679c\u5bf9\u4fee\u6539\u8fc7\u5c5e\u6027\u7684\u6587\u4ef6\u6709\u5b89\u5168\u8981\u6c42\u9700\u8981\u8bbe\u7f6e\u76f8\u5e94\u7684\u5c5e\u6027\uff0c\u8bf7\u91cd\u65b0\u8bbe\u7f6e\u76f8\u5e94\u7684\u5c5e\u6027\u3002\n\u5982\u679c\u8bbe\u7f6e\u6587\u4ef6\u5c5e\u6027\u4e3a\"i\"\uff0c\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u3002\n\n\t# chattr +i \/etc\/passwd \/etc\/shadow\n\n\u5982\u679c\u8bbe\u7f6e\u6587\u4ef6\u5c5e\u6027\u4e3a\"a\"\uff0c\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u3002\n\n\t# chattr +a \/etc\/passwd \/etc\/shadow\n\n\u67e5\u770b\u4fee\u6539\u540e\u7684\u6587\u4ef6\u5c5e\u6027\uff0c\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u3002\n\n\n\t# lsattr \/etc\/passwd \/etc\/shadow\n\n"}