{"id":116847,"date":"2018-08-28T08:02:32","date_gmt":"2018-08-28T00:02:32","guid":{"rendered":"https:\/\/gulass.cn\/?p=116847"},"modified":"2018-08-23T14:03:42","modified_gmt":"2018-08-23T06:03:42","slug":"nomout-user-passwd","status":"publish","type":"post","link":"https:\/\/gulass.cn\/nomout-user-passwd.html","title":{"rendered":"\u5982\u4f55\u89e3\u51b3\u666e\u901a\u7528\u6237\u65e0\u6cd5\u4fee\u6539\u5bc6\u7801"},"content":{"rendered":"
\u73b0\u7f51\u4e00\u53f0suse11 sp3\u4e3b\u673a\u5728\u4f7f\u7528\u666e\u901a\u7528\u6237\u4fee\u6539\u5bc6\u7801\u65f6\uff0c\u65e0\u6cd5\u6b63\u5e38\u4fee\u6539\uff0c\u4f7f\u7528root\u7528\u6237\u53ef\u4ee5\u4fee\u6539\u7528\u6237\u5bc6\u7801\uff0c\u5177\u4f53\u9519\u8bef\u65e5\u5fd7\u5982\u4e0b\uff1a<\/p>\n
<\/a><\/p>\n message\u65e5\u5fd7\u5982\u4e0b\uff1a<\/p>\n \u4ece\u4ee5\u4e0a\u62a5\u9519\u7684\u65e5\u5fd7\u53ca\u5bc6\u7801\u76f8\u5173\u7684\u4e1c\u897f\u6765\u8bf4\uff0c\u6000\u7591\u4ee5\u4e0b\u51e0\u9879\uff1a<\/p>\n 1\u3001\/etc\/passwd\u3001\/etc\/shadow\u6587\u4ef6\u8bbe\u7f6e\u4e86\u7279\u6b8a\u6743\u9650\uff0c\u5bfc\u81f4\u666e\u901a\u7528\u6237passwd\u6267\u884c\u65f6\u65e0\u6cd5\u5199\u5165 \uff0d\uff0d\uff0d\u7ecf\u548c\u5176\u4ed6\u4e3b\u673a\u5bf9\u6bd4\uff0c\u6392\u9664\uff1b<\/p>\n 2\u3001passwd\u547d\u4ee4\u7279\u6b8a\u6743\u9650\u4f4d\u88ab\u56de\u6536\u6216\u8be5\u6587\u4ef6\u88ab\u66f4\u6539\u8fc7 \uff0d\uff0d\uff0d\u5bf9\u4e8e\u540c\u7c7b\u4e3b\u673a\uff0c\u4e5f\u6392\u9664\u8be5\u95ee\u9898\uff1b<\/p>\n 3\u3001\u52a8\u6001\u94fe\u63a5\u5e93so\u6587\u4ef6\u5f02\u5e38\uff0d\uff0d\uff0d\u901a\u8fc7ldd\u547d\u4ee4\u67e5\u770b\uff0c\u53d1\u73b0\u6240\u6709\u94fe\u63a5\u7684so\u5e93\u6587\u4ef6\u90fd\u5b58\u5728\uff0c\u4e14\u7248\u672c\u548c\u6b63\u5e38\u4e3b\u673a\u7684\u7248\u672c\u4e00\u81f4\u3002\u540c\u65f6\u7531\u4e8eroot\u53ef\u4ee5\u6b63\u5e38\u4fee\u6539\uff0c\u8fd9\u4e2a\u53ef\u80fd\u4e5f\u6bd4\u8f83\u5c0f\uff1b<\/p>\n 4\u3001\u65b0\u5efa\u666e\u901a\u7528\u6237\uff0c\u518d\u5207\u5230\u8be5\u95ee\u9898\uff0c\u786e\u8ba4\u662f\u5426\u53ef\u4ee5\u6b63\u5e38\u4fee\u6539\uff0d\uff0d\uff0d\u53d1\u73b0\u65b0\u5efa\u7528\u6237\u4e5f\u65e0\u6cd5\u6b63\u5e38\u4fee\u6539\u81ea\u5df1\u7684\u5bc6\u7801\uff0c\u63d0\u793a\u540c\u4e0a\uff1b<\/p>\n 5\u3001pam\u6587\u4ef6\u4e2d\u6709\u76f8\u5173\u7b56\u7565\uff0d\uff0d\uff0d\u53ef\u80fd\u6027\u6700\u5927\uff0c\u56e0\u4e3amessage\u65e5\u5fd7\u4e2d\u6709pam error 21\u7684\u9519\u8bef \u3002<\/p>\n \u8ddf\u7528\u6237\u8ba4\u8bc1\u76f8\u5173\u7684\u51e0\u4e2apam\u6587\u4ef6\u6709\uff0ccommon-auth\u3001common-password\u3001common-account\u3001common-session\u3001su\u3001sshd \uff0c\u800c\u7b2c\u4e09\u65b9\u5b89\u5168\u52a0\u56fa\u516c\u53f8\u5728\u52a0\u56fa\u65f6\u4e00\u822c\u4f1a\u4fee\u6539\u524d\u4e24\u4e2a\u6587\u4ef6 \u3002\u770b\u4e86\u4e0b\u524d\u4e24\u4e2a\u6587\u4ef6\uff0c\u53d1\u73b0\u4f7f\u6709\u7684\u51e0\u6761\u7b56\u7565\u4e5f\u90fd\u662f\u7ecf\u5e38\u7528\u7684\u51e0\u6761\u914d\u7f6e\uff0c\u6bd4\u8f83\u5bc6\u7801\u957f\u5ea6\u590d\u6742\u5ea6\u3001\u5931\u8d25\u9501\u5b9a\u7b49\u3002\u7b80\u5355\u5c1d\u8bd5\u4fee\u6539\u4e86\u4e24\u5904\uff0c\u53d1\u73b0\u60c5\u51b5\u5e76\u672a\u89e3\u51b3\uff0c\u4e14\u73b0\u7f51\u5927\u591a\u6570\u673a\u5668\u90fd\u52a0\u56fa\u8fc7\uff0c\u5df2\u7ecf\u6ca1\u6709\u5b8c\u5168\u7eaf\u51c0\u7684\u73af\u5883\u53ef\u4ee5\u5bf9\u6bd4\u53c2\u8003\u3002\u521a\u597d\u516c\u53f8\u521a\u65b0\u4e70\u4e86SUSE\u539f\u5382\u7ef4\u4fdd\uff0c\u4e5f\u60f3\u8bd5\u4e0b\u539f\u5382\u7ef4\u4fdd\u7684\u8d28\u91cf\uff0c\u5efa\u5355\u8054\u7cfb\u4e86SUSE\u8ba9\u5176\u5206\u6790\u8be5\u95ee\u9898\u3002<\/p>\n \u539f\u5382\u7684\u5206\u6790\u601d\u8def\uff1a<\/p>\n 1\u3001\u57fa\u672c\u4e0a\u4e5f\u662f\u7167\u6211\u4e0a\u9762\u8bf4\u7684\u5148\u770b\u4e86\u4e00\u904d\uff0c\u672a\u53d1\u73b0\u660e\u663e\u95ee\u9898\u3002\u5728pam\u7b56\u7565\u4e0a\u4e5f\u6ce8\u91ca\u4e86\u4e24\u5904\uff0c\u53d1\u73b0\u95ee\u9898\u4ecd\u65e7\uff1b<\/p>\n 2\u3001\u4f7f\u7528strace\u547d\u4ee4\u8fdb\u884c\u8ddf\u8e2a\uff0c\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n -f \u8ddf\u8e2a\u8fdb\u7a0bfork\u7684\u5b50\u8fdb\u7a0b\uff0c-t\u53c2\u6570\u6253\u5370\u65f6\u95f4\u4fe1\u606f\u3002<\/p>\n \u67e5\u770b\u8f93\u51fa\u7684\u8fd9\u90e8\u5206\u65e5\u5fd7\u4fe1\u606f\uff0c\u53d1\u73b0\u5728\u6267\u884cpasswd\u547d\u4ee4\u4fee\u6539\u524d\u4e5f\u65e0\u660e\u663e\u9519\u8bef\u3002<\/p>\n 3\u3001\u518d\u6b21\u68c0\u67e5pam\u6587\u4ef6\uff0c\u5b98\u65b9\u5c06common-password\u91cc\u7684\u6240\u6709\u89c4\u5219\u5168\u90e8\u8fd8\u539f\u4e3a\u521d\u59cb\u8bbe\u7f6e\u540e\uff0c\u518d\u8fdb\u884c\u5bc6\u7801\u4fee\u6539\u9a8c\u8bc1\uff0c\u53d1\u73b0\u95ee\u9898\u89e3\u51b3\u3002common-password\u52a0\u56fa\u548c\u521d\u59cb\u503c\u5206\u522b\u5982\u4e0b\uff1a<\/p>\n \u95ee\u9898\u867d\u7136\u89e3\u51b3\uff0c\u4e0d\u8fc7\u539f\u5382\u5de5\u7a0b\u5e08\u4e5f\u7ed9\u51fa\u4e86\u5efa\u8bae\uff0ccommon-auth\u3001common-password\u3001common-account\u3001common-session\u8fd9\u56db\u4e2a\u6587\u4ef6\u5206\u522b\u5199\u7684\u7b56\u7565\u662f auth\u3001password\u3001account\u3001session\u76f8\u5173\u7684\u5185\u5bb9\uff0c\u5efa\u8bae\u6bcf\u4e2a\u6587\u4ef6\u91cc\uff0c\u53ea\u5199\u5165\u8ddf\u8be5\u7b56\u7565\u76f8\u5173\u7684\u5185\u5bb9\u3002\u6bd4\u5982common-password\u91cc\uff0c\u53ea\u5199\u5165password\u5f00\u5934\u7684\u5185\u5bb9\uff0c\u800c\u5b89\u5168\u52a0\u56fa\u5382\u5bb6\u5728\u52a0\u56fa\u65f6\uff0c\u628aauth\u548c session\u76f8\u5173\u7684\u4e1c\u897f\u4e5f\u5199\u5728\u4e86\u8be5\u6587\u4ef6\u5185\u3002\u8fd9\u6837\u5199\uff0c\u5bb9\u6613\u9020\u6210\u914d\u7f6e\u6df7\u4e71\uff0c\u4e14\u67d0\u4e9b\u6a21\u5757\u91cd\u590d\u52a0\u8f7d\u3002<\/p>\n \u539f\u6587\u6765\u81ea\uff1ahttp:\/\/www.361way.com\/passwd-recoverd\/5491.html<\/a><\/p>\nJun 16 11:35:47 ZJHZ-CMREAD-CGTEST17 passwd[16285]: password change failed, pam error 21 - account=bcwap, uid=3954, by=3954\r\nJun 16 11:36:29 ZJHZ-CMREAD-CGTEST17 su: (to zabbix) zabbix on \/dev\/pts\/2\r\nJun 16 11:36:37 ZJHZ-CMREAD-CGTEST17 passwd[16712]: User zabbix: Authentication information cannot be recovered\r\nJun 16 11:36:37 ZJHZ-CMREAD-CGTEST17 passwd[16712]: password change failed, pam error 21 - account=zabbix, uid=6606, by=6606\r\n<\/pre>\n
strace -o \/tmp\/pw.log -ft su - testuser -c \"passwd\"\r\n<\/pre>\n
\u52a0\u56fa\u540e\uff1a\r\nauth required pam_unix2.so nullok\r\naccount required pam_unix2.so\r\nsession required pam_unix2.so\r\npassword required pam_pwcheck.so nullok\r\npassword required pam_unix2.so nullok use_first_pass use_authtok\r\npassword required pam_unix.so remember=5 use_authtok md5 shadow\r\npassword required pam_cracklib.so min=disabled,12,8,6,5 max=40 passphrase=3 match=4 similar=deny random=42 enforce=everyone retry=3\r\n\u521d\u59cb\u503c\uff1a\r\npassword required pam_pwcheck.so nullok cracklib\r\npassword required pam_unix2.so nullok use_authtok\r\n<\/pre>\n
\n