{"id":359186,"date":"2024-05-21T00:27:22","date_gmt":"2024-05-21T00:27:22","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=359186"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=359186","title":{"rendered":"<span>Gryffine \u2014 \u0438\u0441\u0442\u043e\u0440\u0438\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0435\u0442-\u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041a\u0430\u043a-\u0442\u043e \u0440\u0430\u0437 \u043e\u0434\u0438\u043d \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u0439 \u0441\u0438\u0441\u0430\u0434\u043c\u0438\u043d \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u043b\u0441\u044f \u043c\u043d\u0435 \u043d\u0430 \u0436\u0438\u0437\u043d\u044c \u0441\u0443\u0440\u043e\u0432\u0443\u044e. \u041e\u043d \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u043b \u043e\u0431 \u043e\u0434\u043d\u043e\u043c \u0438\u043d\u0446\u0438\u0434\u0435\u043d\u0442\u0435 \u0432 \u0435\u0433\u043e \u043a\u043e\u043d\u0442\u043e\u0440\u0435. \u0421\u0442\u043e\u0438\u0442 \u043e\u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043a\u043e\u043d\u0442\u043e\u0440\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0438 \u0442\u0430\u043a\u043e\u0439 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u043a\u0430\u043a \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442 \u043f\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0442\u0430\u043c \u043d\u0435\u0442. \u0418\u043d\u0446\u0438\u0434\u0435\u043d\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0434\u043e \u0431\u0430\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u0421\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u043b\u0438 \u0430\u043d\u043e\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u043d\u0430 \u043b\u0438\u043d\u0443\u043a\u0441\u043e\u0432\u044b\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445. \u041f\u043e\u0434\u043e\u0437\u0440\u0435\u043d\u0438\u044f \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u043b\u0438\u0441\u044c \u0432\u044b\u0432\u043e\u0434\u043e\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u044b who, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043a\u0430\u0437\u0430\u043b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u043e ssh \u0441 \u043f\u0440\u043e\u043a\u0441\u0438-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0441 IP \u043e\u0434\u043d\u043e\u0439 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0439, \u043d\u043e \u043e\u0447\u0435\u043d\u044c \u0433\u043e\u0440\u0434\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u044b. \u0414\u0430\u043b\u044c\u0448\u0435 \u0431\u044b\u043b\u043e \u0442\u043e, \u0447\u0442\u043e \u0438 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043e \u0432 \u0442\u0430\u043a\u0438\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f\u0445, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e: \u0441\u043c\u0435\u043d\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u044b, \u043f\u043e\u043d\u044f\u0442\u044c \u043e\u0442\u043a\u0443\u0434\u0430 \u0437\u0430\u0440\u0430\u0437\u0430 \u043f\u043e \u0441\u0435\u0442\u0438 \u043f\u043e\u0448\u043b\u0430, \u0438 \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u043d\u0430 \u0434\u0435\u043b\u0430\u043b\u0430. \u0414\u043e\u0441\u0442\u0443\u043f\u044b \u0441\u043c\u0435\u043d\u0438\u043b\u0438, \u0430 \u0432\u043e\u0442 \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u0435\u0437\u043b\u0438 \u0432 \u043b\u043e\u0433\u0438, \u0441 \u0443\u0434\u0438\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b, \u0447\u0442\u043e \u043e\u043d\u0438 \u0443\u0436\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u043d\u0435\u0439 \u043a\u0430\u043a \u043f\u0438\u0448\u0443\u0442\u0441\u044f \u0432 \/dev\/null, \u0442\u043e \u0435\u0441\u0442\u044c \u0443 \u0437\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a\u0430 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0431\u044b\u043b root-\u0434\u043e\u0441\u0442\u0443\u043f. \u041f\u043e\u0437\u0436\u0435 \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u0438, \u0447\u0442\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u043e\u0439 \u0431\u044b\u043b\u0430 \u0443\u0442\u0435\u0447\u043a\u0430 \u043f\u0430\u0440\u043e\u043b\u044f \u043e\u0442 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u043e\u0432 \u0441 \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c \u043a sudo.<\/p>\n<p>\u0418\u0441\u0442\u043e\u0440\u0438\u044f, \u0432 \u043e\u0431\u0449\u0435\u043c-\u0442\u043e, \u0442\u0438\u043f\u0438\u0447\u043d\u0430\u044f, \u0442\u044b\u0441\u044f\u0447\u0438 \u0442\u0430\u043a\u0438\u0445. \u041d\u043e \u043c\u0435\u043d\u044f \u043e\u043d\u0430 \u0437\u0430\u0446\u0435\u043f\u0438\u043b\u0430 \u0438 \u043f\u043e\u0431\u0443\u0434\u0438\u043b\u0430 \u0437\u0430\u0434\u0430\u0442\u044c\u0441\u044f \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u043c: \u0430 \u043a\u0430\u043a, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u043e\u0439\u043c\u0430\u0442\u044c \u0445\u0430\u043a\u0435\u0440\u0430 \u0432 \u0442\u043e\u0442 \u0441\u0430\u043c\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442, \u043a\u043e\u0433\u0434\u0430 \u043e\u043d \u043f\u043e\u043f\u0430\u043b \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0432\u043f\u0435\u0440\u0432\u044b\u0435 \u0438 \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043c \u0437\u0430\u043a\u0440\u0435\u043f\u0438\u0442\u044c\u0441\u044f? \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 enterprise-\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0430\u0443\u0434\u0438\u0442\u0430 \u0438 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0432\u0445\u043e\u0434\u0430 \u043d\u0430 \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u0443\u044e \u043c\u0430\u0448\u0438\u043d\u0443, \u043d\u043e \u0434\u0430\u0436\u0435 \u043a\u0440\u0443\u043f\u043d\u044b\u0439 \u0431\u0438\u0437\u043d\u0435\u0441 \u0441 \u043d\u0435\u043e\u0445\u043e\u0442\u043e\u0439 \u0442\u0440\u0430\u0442\u0438\u0442\u0441\u044f \u043d\u0430 \u0438\u043d\u0444\u043e\u0431\u0435\u0437. \u041d\u0435 \u0433\u043e\u0432\u043e\u0440\u044f \u0443\u0436\u0435 \u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043a\u043e\u043d\u0442\u043e\u0440\u0430\u0445 \u0441 IT-\u043e\u0442\u0434\u0435\u043b\u043e\u043c \u0432 3,5 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430. \u0411\u0443\u0434\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0441\u0451 \u0441\u0430\u043c\u0438, \u0431\u043b\u0430\u0433\u043e \u0432 \u043b\u0438\u043d\u0443\u043a\u0441\u0430\u0445 \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0435\u0441\u0442\u044c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438.<\/p>\n<p><abbr class=\"habraabbr\" title=\"Pluggable Authentication Modules, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438\" data-title=\"&lt;p>Pluggable Authentication Modules, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438&lt;\/p>&#187; data-abbr=&#187;PAM&#187;>PAM<\/abbr> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432\u043e \u0432\u0441\u0435\u0445 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 *nix-like \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445. <a href=\"https:\/\/wiki.archlinux.org\/title\/PAM_(%D0%A0%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9)\" rel=\"noopener noreferrer nofollow\">\u0410\u0440\u0447-\u0432\u0438\u043a\u0438<\/a> \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430\u043c, \u0447\u0442\u043e PAM \u2014 \u044d\u0442\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0434\u043b\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435. PAM \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043e\u0442 \u0441\u0445\u0435\u043c\u044b \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u0412\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u044e\u0442\u0441\u044f \u043c\u043e\u0434\u0443\u043b\u0438 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u041a\u0430\u043a\u043e\u0439 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u043c\u043e\u0434\u0443\u043b\u044c \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d, \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438 \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u043d\u0430 \u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u0435 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430.<\/p>\n<p>\u041f\u0440\u043e\u0449\u0435 \u0433\u043e\u0432\u043e\u0440\u044f, \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f PAM \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u0434\u0432\u0443\u0445\u0444\u0430\u043a\u0442\u043e\u0440\u043d\u043e\u0439 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u043d\u0443 \u0438\u043b\u0438 \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435. PAM \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 Linux-\u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445, \u043d\u043e \u0438 \u0442\u0430\u043a\u0436\u0435 \u0432 BSD \u0438 MacOS. \u041d\u043e \u0440\u0430\u0437 \u0443\u0436 \u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043f\u0440\u043e Linux, \u043d\u0430 \u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0438 \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c.<\/p>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 PAM \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0430\u0445, \u043b\u0435\u0436\u0430\u0449\u0438\u0445 \u0432 \/etc\/pam.conf \u0438 \/etc\/pam.d\/. \u0422\u0443\u0434\u0430 \u043c\u044b \u0438 \u0432\u0437\u0433\u043b\u044f\u043d\u0435\u043c.<\/p>\n<details class=\"spoiler\">\n<summary>\/etc\/pam.d\/login<\/summary>\n<div class=\"spoiler__content\">\n<pre><code># # The PAM configuration file for the Shadow `login' service #  # Enforce a minimal delay in case of failure (in microseconds). # (Replaces the `FAIL_DELAY' setting from login.defs) # Note that other modules may require another minimal delay. (for example, # to disable any delay, you should add the nodelay option to pam_unix) auth       optional   pam_faildelay.so  delay=3000000  # Outputs an issue file prior to each login prompt (Replaces the # ISSUE_FILE option from login.defs). Uncomment for use # auth       required   pam_issue.so issue=\/etc\/issue  # Disallows other than root logins when \/etc\/nologin exists # (Replaces the `NOLOGINS_FILE' option from login.defs) auth       requisite  pam_nologin.so  # SELinux needs to be the first session rule. This ensures that any # lingering context has been cleared. Without this it is possible # that a module could execute code in the wrong domain. # When the module is present, \"required\" would be sufficient (When SELinux # is disabled, this returns success.) session [success=ok ignore=ignore module_unknown=ignore default=bad] pam_selinux.so close  # Sets the loginuid process attribute session    required     pam_loginuid.so  # Prints the message of the day upon successful login. # (Replaces the `MOTD_FILE' option in login.defs) # This includes a dynamically generated part from \/run\/motd.dynamic # and a static (admin-editable) part from \/etc\/motd. session    optional   pam_motd.so motd=\/run\/motd.dynamic session    optional   pam_motd.so noupdate  # SELinux needs to intervene at login time to ensure that the process # starts in the proper default security context. Only sessions which are # intended to run in the user's context should be run after this. # pam_selinux.so changes the SELinux context of the used TTY and configures # SELinux in order to transition to the user context with the next execve() # call. session [success=ok ignore=ignore module_unknown=ignore default=bad] pam_selinux.so open # When the module is present, \"required\" would be sufficient (When SELinux # is disabled, this returns success.)  # This module parses environment configuration file(s) # and also allows you to use an extended config # file \/etc\/security\/pam_env.conf. #  # parsing \/etc\/environment needs \"readenv=1\" session       required   pam_env.so readenv=1 # locale variables are also kept into \/etc\/default\/locale in etch # reading this file *in addition to \/etc\/environment* does not hurt session       required   pam_env.so readenv=1 envfile=\/etc\/default\/locale  # Standard Un*x authentication. @include common-auth  # This allows certain extra groups to be granted to a user # based on things like time of day, tty, service, and user. # Please edit \/etc\/security\/group.conf to fit your needs # (Replaces the `CONSOLE_GROUPS' option in login.defs) auth       optional   pam_group.so  # Uncomment and edit \/etc\/security\/time.conf if you need to set # time restraint on logins. # (Replaces the `PORTTIME_CHECKS_ENAB' option from login.defs # as well as \/etc\/porttime) # account    requisite  pam_time.so  # Uncomment and edit \/etc\/security\/access.conf if you need to # set access limits. # (Replaces \/etc\/login.access file) # account  required       pam_access.so  # Sets up user limits according to \/etc\/security\/limits.conf # (Replaces the use of \/etc\/limits in old login) session    required   pam_limits.so  # Prints the last login info upon successful login # (Replaces the `LASTLOG_ENAB' option from login.defs) session    optional   pam_lastlog.so  # Prints the status of the user's mailbox upon successful login # (Replaces the `MAIL_CHECK_ENAB' option from login.defs).  # # This also defines the MAIL environment variable # However, userdel also needs MAIL_DIR and MAIL_FILE variables # in \/etc\/login.defs to make sure that removing a user  # also removes the user's mail spool file. # See comments in \/etc\/login.defs session    optional   pam_mail.so standard  # Create a new session keyring. session    optional   pam_keyinit.so force revoke  # Standard Un*x account and session @include common-account @include common-session @include common-password<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0434\u043b\u044f \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438\u043b\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439. \u0421\u0442\u0440\u043e\u043a\u0430 \u0432 \u0444\u0430\u0439\u043b\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u0434\u043d\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e.<\/p>\n<p>\u041a\u0430\u0436\u0434\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0442\u0440\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430: \u0442\u0438\u043f \u043c\u043e\u0434\u0443\u043b\u044f, control_flag \u0438 \u0438\u043c\u044f \u043c\u043e\u0434\u0443\u043b\u044f. \u041d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0435\u0441 \u0434\u043b\u044f \u043d\u0430\u0441 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u043c\u043e\u0434\u0443\u043b\u0438 \u0442\u0438\u043f\u0430 &#171;auth&#187;, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u043d\u0438 \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0442 \u0437\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e. Control_flag \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043c\u043e\u0434\u0443\u043b\u044f \u0438 \u043c\u043e\u0436\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>requisite (\u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439) \u2014 \u0435\u0441\u043b\u0438 \u043c\u043e\u0434\u0443\u043b\u044c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442, \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0432 \u0446\u0435\u043f\u043e\u0447\u043a\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f, \u0438 \u0437\u0430\u043f\u0440\u043e\u0441 \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u0435\u0442\u0441\u044f. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0435\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e \u043e\u0442\u0432\u0435\u0440\u0433\u0430\u0435\u0442\u0441\u044f, \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f.<\/p>\n<\/li>\n<li>\n<p>required (\u0442\u0440\u0435\u0431\u0443\u0435\u043c\u044b\u0439) \u2014 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e requisite: \u043f\u0440\u0438 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u043c \u043e\u0442\u0432\u0435\u0442\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0432 \u0446\u0435\u043f\u043e\u0447\u043a\u0435. \u041e\u0442\u043b\u0438\u0447\u0438\u0435 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0440\u0438 \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u043c \u043e\u0442\u0432\u0435\u0442\u0435 \u0446\u0435\u043f\u043e\u0447\u043a\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443, \u043d\u043e \u0437\u0430\u043f\u0440\u043e\u0441 \u043e\u0442\u043a\u043b\u043e\u043d\u044f\u0435\u0442\u0441\u044f.<\/p>\n<\/li>\n<li>\n<p>sufficient (\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u044b\u0439) \u2014 \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441, \u0435\u0441\u043b\u0438 \u043d\u0438 \u043e\u0434\u043d\u0430 \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a \u0432 \u0446\u0435\u043f\u043e\u0447\u043a\u0435 \u043d\u0435 \u0432\u0435\u0440\u043d\u0443\u043b\u0430 \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u0433\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442\u0441\u044f.<\/p>\n<\/li>\n<li>\n<p>optional (\u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439) \u2014 \u043c\u043e\u0434\u0443\u043b\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0441\u0432\u043e\u044e \u0440\u0430\u0431\u043e\u0442\u0443, \u043d\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0435 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f.<\/p>\n<\/li>\n<\/ul>\n<p>\u041e\u0431\u0449\u0438\u0435 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0432 common-auth, \u0432\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u0438 \u0442\u0443\u0434\u0430 \u0442\u043e\u0436\u0435.<\/p>\n<details class=\"spoiler\">\n<summary>\/etc\/pam.d\/common-auth<\/summary>\n<div class=\"spoiler__content\">\n<pre><code># # \/etc\/pam.d\/common-auth - authentication settings common to all services # # This file is included from other service-specific PAM config files, # and should contain a list of the authentication modules that define # the central authentication scheme for use on the system # (e.g., \/etc\/shadow, LDAP, Kerberos, etc.).  The default is to use the # traditional Unix authentication mechanisms. # # As of pam 1.0.1-6, this file is managed by pam-auth-update by default. # To take advantage of this, it is recommended that you configure any # local modules either before or after the default block, and use # pam-auth-update to manage selection of other modules.  See # pam-auth-update(8) for details.  # here are the per-package modules (the \"Primary\" block) auth[success=1 default=ignore]pam_unix.so nullok # here's the fallback if no module succeeds authrequisitepam_deny.so # prime the stack with a positive return value if there isn't one already; # this avoids us returning an error just because nothing sets a success code # since the modules above will each just jump around authrequiredpam_permit.so # and here are more per-package modules (the \"Additional\" block) # end of pam-auth-update config<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0427\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442: \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043c\u043e\u0434\u0443\u043b\u044c pam_unix.so, \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u043a\u0438 pam_unix.so \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f pam_deny.so \u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0443\u0441\u043f\u0435\u0445\u0430 pam_unix.so \u0441\u043b\u0435\u0434\u0443\u0435\u0442  \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0440\u043e\u0447\u043a\u0438, \u0442\u043e \u0435\u0441\u0442\u044c pam_deny.so \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f pam_permit.so.<\/p>\n<p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e. \u0412 \u043e\u0434\u0438\u043d \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0437\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0440\u0443\u0442\u0430, \u0441\u0435\u0440\u0432\u0435\u0440 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0435\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c. \u0412\u0435\u0440\u0438\u0442\u044c \u043b\u043e\u0433\u0430\u043c \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043c\u044b \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043c\u043e\u0436\u0435\u043c, \u0445\u0430\u043a\u0435\u0440 \u0438\u043c\u0438 \u043c\u043e\u0436\u0435\u0442 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043f\u0440\u0438\u0447\u0451\u043c \u0445\u0430\u043a\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0436\u0435 \u0432\u044b\u0448\u0435\u043b \u0438\u0437 \u0448\u043a\u043e\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430 \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u043e \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u043f\u043e\u0442\u0435\u0440\u0435\u0432 \u043b\u043e\u0433\u0438 \u0441 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u043c\u0438 (\u0443\u0441\u043f\u0435\u0448\u043d\u044b\u043c\u0438 \u0438 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c) \u043f\u043e\u043f\u044b\u0442\u043a\u0430\u043c\u0438 \u043f\u0440\u043e\u0439\u0442\u0438 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u0447\u0442\u043e \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442. \u041f\u0435\u0440\u0438\u043c\u0435\u0442\u0440\u043e\u043c \u0430\u0442\u0430\u043a\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u0435\u0440\u0432\u0435\u0440, \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u043b\u043e\u0433\u0438\u043d\u0430 \u043a\u0443\u0434\u0430-\u0442\u043e \u0432\u043e\u0432\u043d\u0435 \u044d\u0442\u043e\u0433\u043e \u0441\u0430\u043c\u043e\u0433\u043e \u043f\u0435\u0440\u0438\u043c\u0435\u0442\u0440\u0430. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 PAM-\u043c\u043e\u0434\u0443\u043b\u044c. \u0410 \u043c\u043e\u0436\u043d\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442\u044c\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u044b\u043c \u0447\u0435\u0440\u0435\u0437 pam_exec.so. \u041d\u0430 \u0433\u0438\u0442\u0445\u0430\u0431\u0435 \u0435\u0441\u0442\u044c \u043a\u0443\u0447\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432, \u0441 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u043e\u0439 \u043b\u043e\u0433\u043e\u0432 \u0432 Telegram, Slack, Discord, \u0434\u0430 \u043a\u0443\u0434\u0430 \u0443\u0433\u043e\u0434\u043d\u043e. \u041d\u043e \u0435\u0441\u043b\u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f, \u043c\u043e\u0436\u043d\u043e \u043d\u0430 \u043a\u043e\u043b\u0435\u043d\u043a\u0435 \u043d\u0430\u043a\u0438\u0434\u0430\u0442\u044c \u0441\u0430\u043c\u043e\u043c\u0443 \u0437\u0430 5 \u043c\u0438\u043d\u0443\u0442.<\/p>\n<p>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f pam_exe\u0441 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f. PAM_SERVICE \u2014 \u0441\u0435\u0440\u0432\u0438\u0441, \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043b\u043e\u0433\u0438\u043d, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 ssh, logind \u0438\u043b\u0438 lightdm. PAM_USER \u2014 \u043b\u043e\u0433\u0438\u043d \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043f\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u0432\u0445\u043e\u0434\u0430. PAM_RHOST \u2014 IP \u043c\u0430\u0448\u0438\u043d\u044b, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u0445\u043e\u0434, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u043e\u0433\u043e \u0432\u0445\u043e\u0434\u0430.<\/p>\n<p>\u041a\u043e\u0434 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0441 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u043e\u0439 \u0432 Telegram:<\/p>\n<pre><code class=\"python\">#!\/usr\/bin\/python3 import requests from os import environ, uname from sys import argv  TELEGRAM_TOKEN = '\u0442\u043e\u043a\u0435\u043d \u0431\u043e\u0442\u0430' TELEGRAM_CHAT_ID = 'ID \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u044f \u043e\u0442\u0447\u0451\u0442\u043e\u0432'  if argv[1] == 'success':     status = 'successful' elif argv[1] == 'fail':     status = 'failed'  message = f\"Detected {status} login on server {uname()[1]} through {environ['PAM_SERVICE']} by user {environ['PAM_USER']} from remote host {environ.get('PAM_RHOST')}.\"  requests.get(f'https:\/\/api.telegram.org\/bot{TELEGRAM_TOKEN}\/sendMessage?chat_id={TELEGRAM_CHAT_ID}&amp;text={message}')<\/code><\/pre>\n<p>\u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c \/etc\/pam.d\/common-auth:<\/p>\n<pre><code># here are the per-package modules (the \"Primary\" block) auth    [success=2 default=ignore]      pam_unix.so nullok # here's the fallback if no module succeeds auth    optional                        pam_exec.so \/usr\/local\/bin\/our_script.py fail auth    requisite                       pam_deny.so # prime the stack with a positive return value if there isn't one already; # this avoids us returning an error just because nothing sets a success code # since the modules above will each just jump around auth    optional                        pam_exec.so \/usr\/local\/bin\/our_script.py success auth    required                        pam_permit.so # and here are more per-package modules (the \"Additional\" block) auth    optional                        pam_cap.so  # end of pam-auth-update config <\/code><\/pre>\n<p>\u0427\u0442\u043e \u043c\u044b \u0437\u0434\u0435\u0441\u044c \u0441\u0434\u0435\u043b\u0430\u043b\u0438:<\/p>\n<p>\u041c\u0435\u043d\u044f\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 success, \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 2, \u0442\u043e \u0435\u0441\u0442\u044c \u0433\u043e\u0432\u043e\u0440\u0438\u043c: \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0443\u0441\u043f\u0435\u0445\u0430 pam_unix.so \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0432\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438. \u0418 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e, \u043d\u0435 \u0432\u043b\u0438\u044f\u044e\u0449\u0443\u044e \u043d\u0430 \u043a\u043e\u043d\u0435\u0447\u043d\u0443\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443, \u0441 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043d\u0430\u0448 \u0441\u043a\u0440\u0438\u043f\u0442 \u0441 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c fail.<\/p>\n<p>\u041f\u0435\u0440\u0435\u0434 pam_permit.so \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c success.<\/p>\n<p>\u0412 \u043e\u0431\u0449\u0435\u043c-\u0442\u043e \u0432\u0441\u0451 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e, \u043d\u043e \u043a\u043e\u0433\u0434\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u0438\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043c\u043d\u043e\u0433\u043e, \u043b\u043e\u0433\u0438 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u044e\u0442\u0441\u044f \u0432 \u043c\u0435\u0441\u0438\u0432\u043e. \u0412\u0440\u043e\u0434\u0435 \u0431\u044b \u0438 \u0432\u0438\u0434\u043d\u043e, \u043a\u0442\u043e, \u043a\u043e\u0433\u0434\u0430 \u0438 \u043a\u0443\u0434\u0430 \u0437\u0430\u0448\u0451\u043b, \u043d\u043e \u0433\u043b\u0430\u0437\u0430 \u0437\u0430\u043c\u044b\u043b\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0438 \u0432 \u0434\u043b\u0438\u043d\u043d\u043e\u043c \u0441\u043f\u0438\u0441\u043a\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043e \u043b\u043e\u0433\u0438\u043d\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0442\u0438\u0447\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043d\u0443\u0436\u043d\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c \u0438\u043b\u0438 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c \u0430\u043d\u043e\u043c\u0430\u043b\u0438\u044e. \u0427\u0442\u043e \u0436, \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 \u0431\u0435\u0437\u044b\u043c\u044f\u043d\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442\u0438\u043a \u0432 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0438 \u0430\u0443\u0434\u0438\u0442\u0430 \u043f\u043e\u043f\u044b\u0442\u043e\u043a \u043b\u043e\u0433\u0438\u043d\u0430. \u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0438\u043c\u044f <a href=\"https:\/\/github.com\/PressXToWin\/gryffine-server\/\" rel=\"noopener noreferrer nofollow\">Gryffine<\/a>.<\/p>\n<p>\u041c\u044b \u043f\u043e\u043c\u043d\u0438\u043c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u043b\u043e\u0433\u0438 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u044b \u043f\u0435\u0440\u0438\u043c\u0435\u0442\u0440\u0430 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0430\u0442\u0430\u043a\u0438. \u0415\u0441\u043b\u0438 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0432 Telegram, \u0437\u043d\u0430\u0447\u0438\u0442 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0435\u0451 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u043e API \u043d\u0430 \u0441\u0432\u043e\u0439 \u0441\u0435\u0440\u0432\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>\u041c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u043c <a href=\"https:\/\/github.com\/PressXToWin\/gryffine-client\/blob\/main\/gryffine.py\" rel=\"noopener noreferrer nofollow\">\u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0443\u044e \u0447\u0430\u0441\u0442\u044c <\/a>\u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0432 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e\u043c \u0434\u043b\u044f \u043c\u0430\u0448\u0438\u043d\u044b \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435:<\/p>\n<pre><code class=\"python\">#!\/usr\/bin\/python3 import requests from os import environ, uname from sys import argv from syslog import syslog, LOG_ERR  endpoint = argv[1]  record = {     'hostname': uname()[1],     'service': environ['PAM_SERVICE'],     'user': environ['PAM_USER'],     'rhost': environ.get('PAM_RHOST') # \u041c\u043e\u0436\u0435\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043f\u0443\u0441\u0442\u044b\u043c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0437\u0434\u0435\u0441\u044c \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u0442\u043e\u0434 .get, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c Null, \u0430 \u043d\u0435 KeyError } if argv[2] == 'success':     record['is_successful'] = True elif argv[2] == 'fail':     record['is_successful'] = False  try:     requests.post(endpoint, json=record) except Exception as err:     error_message = 'Gryffine monitoring system error: '     error_message += str(err)     syslog(LOG_ERR, error_message)<\/code><\/pre>\n<p>\u0421\u0443\u0442\u044c \u0432\u0441\u044f \u0442\u0430 \u0436\u0435 \u0441\u0430\u043c\u0430\u044f, \u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u043f\u0430\u0440\u044b \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u0432. \u0414\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043d\u0430 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043c\u0430\u0448\u0438\u043d \u0432\u044b\u043d\u043e\u0441\u0438\u043c \u0432 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0438\u0439 \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u044c \u0432 syslog \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0430\u0445. \u0420\u0430\u0437 \u043c\u044b \u043f\u043e\u043c\u0435\u043d\u044f\u043b\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b, \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0435\u0449\u0451 \u0440\u0430\u0437 \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c common-auth.<\/p>\n<pre><code># here are the per-package modules (the \"Primary\" block) auth    [success=2 default=ignore]      pam_unix.so nullok # here's the fallback if no module succeeds auth    optional                        pam_exec.so \/usr\/local\/bin\/gryffine.py http:\/\/gryffine-server\/api\/v1\/records\/ fail auth    requisite                       pam_deny.so # prime the stack with a positive return value if there isn't one already; # this avoids us returning an error just because nothing sets a success code # since the modules above will each just jump around auth    optional                        pam_exec.so \/usr\/local\/bin\/gryffine.py http:\/\/gryffine-server\/api\/v1\/records\/ success auth    required                        pam_permit.so # and here are more per-package modules (the \"Additional\" block) auth    optional                        pam_cap.so  # end of pam-auth-update config<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0438\u0448\u0435\u043c \u0431\u044d\u043a\u0435\u043d\u0434 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u041d\u0430 \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u043b\u043e\u0433\u0438\u043d\u0430 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435:<\/p>\n<pre><code class=\"json\">{     \"service\": \"\",          # \u0441\u0435\u0440\u0432\u0438\u0441, \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u0432\u0445\u043e\u0434\u0430 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443     \"user\": \"\",             # \u043b\u043e\u0433\u0438\u043d \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f     \"hostname\": \"\",         # \u0445\u043e\u0441\u0442\u043d\u0435\u0439\u043c \u043c\u0430\u0448\u0438\u043d\u044b, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043b\u043e\u0433\u0438\u043d     \"rhost\": \"\",            # IP, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u0440\u043e\u0441, \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0443\u0441\u0442\u044b\u043c     \"is_successful\": false  # \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 }<\/code><\/pre>\n<p>\u0421 \u044d\u0442\u0438\u043c \u0443\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u0438\u0439 \u0432\u0435\u0431-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u044d\u0442\u0438\u0445 \u043f\u043e\u043f\u044b\u0442\u043e\u043a. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0431\u0435\u0440\u0451\u043c Django, \u0438 \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0449\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0432 \u043e\u0431\u044a\u0435\u043a\u0442 \u0437\u0430\u043f\u0438\u0441\u0438, \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0432\u044b\u0432\u043e\u0434\u0430 \u0432 \u0442\u0430\u0431\u043b\u0438\u0447\u043a\u0443.<\/p>\n<pre><code class=\"python\">class Record(models.Model):     timestamp = models.DateTimeField(auto_now_add=True)     hostname = models.CharField(max_length=50)     service = models.CharField(max_length=50)     user = models.CharField(max_length=50)     rhost = models.GenericIPAddressField(null=True, blank=True)     is_successful = models.BooleanField(default=True)<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/2c9\/e22\/d41\/2c9e22d415a3ad4e0a6b71ea948100ae.png\" alt=\"\u0422\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f.\" title=\"\u0422\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f.\" width=\"793\" height=\"619\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2c9\/e22\/d41\/2c9e22d415a3ad4e0a6b71ea948100ae.png\"\/><\/p>\n<div><figcaption>\u0422\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f.<\/figcaption><\/div>\n<\/figure>\n<p>\u0410 \u0434\u0430\u043b\u044c\u0448\u0435 \u043f\u043e\u0435\u0445\u0430\u043b\u0438 \u043d\u0430\u0432\u0435\u0448\u0438\u0432\u0430\u0442\u044c \u043f\u043b\u044e\u0448\u043a\u0438. \u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0432\u043d\u0435\u0448\u043d\u0438\u0439 IP-\u0430\u0434\u0440\u0435\u0441, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043a \u043a\u0430\u043a\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0435 \u043e\u043d \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442, \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0431\u0430\u0437\u043e\u0439 <a href=\"https:\/\/dev.maxmind.com\/geoip\/geolite2-free-geolocation-data\/\" rel=\"noopener noreferrer nofollow\">GeoLite2<\/a>. \u041f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u043d\u043e\u0441\u0442\u044c IP \u043a \u0442\u043e\u0439 \u0438\u043b\u0438 \u0438\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0435 \u2014 \u044d\u0442\u043e \u0443\u0436\u0435 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0446\u0435\u043d\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f. \u0415\u0441\u043b\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c\u0438 \u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430, \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u0430\u044f \u0432 \u0420\u043e\u0441\u0441\u0438\u0438, \u0442\u043e \u0432\u043d\u0435\u0437\u0430\u043f\u043d\u044b\u0439 \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u0439 \u043b\u043e\u0433\u0438\u043d \u043e\u0442\u043a\u0443\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u0438\u0437 \u041a\u0438\u0442\u0430\u044f \u0438\u043b\u0438 \u042e\u0410\u0420 \u043d\u0430\u0432\u043e\u0434\u0438\u0442 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0435 \u043c\u044b\u0441\u043b\u0438.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043f\u043e \u0441\u0442\u0440\u0430\u043d\u0435, \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0442\u0440\u0430\u043d\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043b\u0430\u0432\u044f\u0442\u0441\u044f \u043e\u0431\u0438\u043b\u0438\u0435\u043c \u0431\u043e\u0442\u043e\u0432 \u043d\u0435 \u043e\u0431\u044a\u044f\u0432\u0438\u0442\u044c \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438? \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0431\u043b\u044d\u043a \u0438 \u0432\u0430\u0439\u0442\u043b\u0438\u0441\u0442\u044b \u0434\u043b\u044f \u0441\u0442\u0440\u0430\u043d \u0438 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u043e\u0432 IP, \u043f\u0440\u0438\u0447\u0451\u043c \u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u0435\u043c \u043e \u0442\u0435\u0445 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u0430\u0445, \u043a\u0442\u043e \u043c\u043e\u0433 \u0440\u0435\u043b\u043e\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f. \u041c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0443 \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u0432 \u0431\u043b\u044d\u043a\u043b\u0438\u0441\u0442, \u0430 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u044b, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043b\u0435\u0433\u0438\u0442\u0438\u043c\u043d\u044b\u0439 \u0432\u0445\u043e\u0434 \u2014 \u0432 \u0432\u0430\u0439\u0442\u043b\u0438\u0441\u0442, \u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0432 \u0432\u0430\u0439\u0442\u043b\u0438\u0441\u0442\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043d\u0435\u0435.<\/p>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435, \u043c\u043e\u0434\u0435\u043b\u0438 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"python\">class Record(models.Model):     timestamp = models.DateTimeField(auto_now_add=True)     hostname = models.CharField(max_length=50)     service = models.CharField(max_length=50)     user = models.CharField(max_length=50)     rhost = models.GenericIPAddressField(null=True, blank=True)     country = CountryField(null=True, blank=True)     is_successful = models.BooleanField(default=True)     is_suspicious = models.BooleanField(null=True, blank=True)  class Rule(models.Model):     country = CountryField(null=True, blank=True)     rhost = models.CharField(max_length=50, null=True, blank=True)<\/code><\/pre>\n<p>\u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u0432\u0441\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u043c \u0440\u0430\u0434\u0438 \u0447\u0435\u0433\u043e \u043c\u044b \u043d\u0430\u0447\u0430\u043b\u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u044c. Django-tables2 \u0434\u0430\u0441\u0442 \u043d\u0430\u043c \u0443\u0434\u043e\u0431\u043d\u043e\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435, \u0430 django-filter \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u0438 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044e. \u0422\u0430\u043a\u0436\u0435 \u043f\u0440\u0438\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u0435\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0430 \u043b\u043e\u0433\u043e\u0432 \u0432 csv \u0438 xls. \u0412 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u043e\u0442 \u0442\u0430\u043a\u0443\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/330\/c0f\/dee\/330c0fdee053b7aafe5c5842c8e392d3.png\" alt=\"\u041b\u0435\u0433\u0435\u043d\u0434\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u044b: \u043a\u0440\u0430\u0441\u043d\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u043e\u0437\u043d\u0430\u0447\u0430\u044e\u0442 \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u0439 \u043b\u043e\u0433\u0438\u043d, \u043f\u043e\u043f\u0430\u0432\u0448\u0438\u0439 \u043f\u043e\u0434 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0438\u0437 \u0431\u043b\u044d\u043a\u043b\u0438\u0441\u0442\u0430, \u0437\u0435\u043b\u0451\u043d\u044b\u0435 \u2014 \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u0439 \u043b\u043e\u0433\u0438\u043d\u044b \u0438\u0437-\u043f\u043e\u0434 \u0432\u0430\u0439\u0442\u043b\u0438\u0441\u0442\u0430, \u0436\u0451\u043b\u0442\u044b\u0435 \u2014 \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u0435 \u043b\u043e\u0433\u0438\u043d\u044b, \u043d\u0435 \u043f\u043e\u043f\u0430\u0432\u0448\u0438\u0435 \u043d\u0438 \u043f\u043e\u0434 \u043e\u0434\u043d\u043e \u0438\u0437 \u043f\u0440\u0430\u0432\u0438\u043b. \u041f\u0440\u043e\u0432\u0430\u043b\u0435\u043d\u043d\u044b\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u043b\u043e\u0433\u0438\u043d\u0430 \u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u0435\u0440\u044b\u0435.\" title=\"\u041b\u0435\u0433\u0435\u043d\u0434\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u044b: \u043a\u0440\u0430\u0441\u043d\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u043e\u0437\u043d\u0430\u0447\u0430\u044e\u0442 \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u0439 \u043b\u043e\u0433\u0438\u043d, \u043f\u043e\u043f\u0430\u0432\u0448\u0438\u0439 \u043f\u043e\u0434 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0438\u0437 \u0431\u043b\u044d\u043a\u043b\u0438\u0441\u0442\u0430, \u0437\u0435\u043b\u0451\u043d\u044b\u0435 \u2014 \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u0439 \u043b\u043e\u0433\u0438\u043d\u044b \u0438\u0437-\u043f\u043e\u0434 \u0432\u0430\u0439\u0442\u043b\u0438\u0441\u0442\u0430, \u0436\u0451\u043b\u0442\u044b\u0435 \u2014 \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u0435 \u043b\u043e\u0433\u0438\u043d\u044b, \u043d\u0435 \u043f\u043e\u043f\u0430\u0432\u0448\u0438\u0435 \u043d\u0438 \u043f\u043e\u0434 \u043e\u0434\u043d\u043e \u0438\u0437 \u043f\u0440\u0430\u0432\u0438\u043b. \u041f\u0440\u043e\u0432\u0430\u043b\u0435\u043d\u043d\u044b\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u043b\u043e\u0433\u0438\u043d\u0430 \u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u0435\u0440\u044b\u0435.\" width=\"1920\" height=\"944\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/330\/c0f\/dee\/330c0fdee053b7aafe5c5842c8e392d3.png\"\/><\/p>\n<div><figcaption>\u041b\u0435\u0433\u0435\u043d\u0434\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u044b: \u043a\u0440\u0430\u0441\u043d\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u043e\u0437\u043d\u0430\u0447\u0430\u044e\u0442 \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u0439 \u043b\u043e\u0433\u0438\u043d, \u043f\u043e\u043f\u0430\u0432\u0448\u0438\u0439 \u043f\u043e\u0434 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0438\u0437 \u0431\u043b\u044d\u043a\u043b\u0438\u0441\u0442\u0430, \u0437\u0435\u043b\u0451\u043d\u044b\u0435 \u2014 \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u0439 \u043b\u043e\u0433\u0438\u043d\u044b \u0438\u0437-\u043f\u043e\u0434 \u0432\u0430\u0439\u0442\u043b\u0438\u0441\u0442\u0430, \u0436\u0451\u043b\u0442\u044b\u0435 \u2014 \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u0435 \u043b\u043e\u0433\u0438\u043d\u044b, \u043d\u0435 \u043f\u043e\u043f\u0430\u0432\u0448\u0438\u0435 \u043d\u0438 \u043f\u043e\u0434 \u043e\u0434\u043d\u043e \u0438\u0437 \u043f\u0440\u0430\u0432\u0438\u043b. \u041f\u0440\u043e\u0432\u0430\u043b\u0435\u043d\u043d\u044b\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u043b\u043e\u0433\u0438\u043d\u0430 \u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u0435\u0440\u044b\u0435.<\/figcaption><\/div>\n<\/figure>\n<p>\u0426\u0435\u043b\u044c \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u0432\u0445\u043e\u0434\u0430 \u043d\u0435 \u0441\u0442\u0430\u0432\u0438\u0442\u0441\u044f. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0435\u0441\u0442\u044c \u0444\u0430\u0435\u0440\u0432\u043e\u043b\u043b\u044b, fail2ban, \u043a\u043e\u0440\u043e\u0447\u0435 \u0433\u043e\u0432\u043e\u0440\u044f, \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b. \u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u043d\u0435\u0441\u0451\u0442 \u043f\u043e \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u044b\u0439 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440: \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c &#171;\u043a\u0440\u0430\u0441\u043d\u0430\u044f&#187; \u0437\u0430\u043f\u0438\u0441\u044c \u2014 \u0437\u043d\u0430\u0447\u0438\u0442 \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442, \u0443\u0442\u043e\u0447\u043d\u0438\u0442\u044c \u043d\u0435 \u0437\u0430\u0431\u044b\u043b \u043b\u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u0445 \u043f\u0435\u0440\u0435\u0434 \u0432\u0445\u043e\u0434\u043e\u043c \u043d\u0430 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c VPN \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u043c\u043e\u0442\u0440\u0435\u043b Netflix, \u0438\u043b\u0438 \u044d\u0442\u043e \u0432\u0441\u0451-\u0442\u0430\u043a\u0438 \u0445\u0430\u043a\u0435\u0440\u044b \u0448\u0430\u043b\u044f\u0442. \u041c\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u044b\u0445 \u2014 \u0437\u043d\u0430\u0447\u0438\u0442 \u043f\u043b\u043e\u0445\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d \u0444\u0430\u0435\u0440\u0432\u043e\u043b\u043b, \u0431\u043e\u0442\u044b \u0431\u0440\u0443\u0442\u044f\u0442 ssh.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0430\u0447\u0430\u043b \u043d\u0430\u0432\u0435\u0448\u0438\u0432\u0430\u0442\u044c \u043f\u043b\u044e\u0448\u043a\u0438, \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0442\u0440\u0443\u0434\u043d\u043e \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f. \u0412\u0435\u0440\u043d\u0451\u043c \u043e\u043f\u043e\u0432\u0435\u0449\u0435\u043d\u0438\u044f \u043e \u043b\u043e\u0433\u0438\u043d\u0435 \u0432 Telegram, \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u044d\u0442\u0438\u043c \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f \u0441\u0435\u0440\u0432\u0435\u0440. \u041f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 \u0437\u0430\u043f\u0438\u0441\u0438 \u043b\u043e\u0433\u0430 \u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431 \u044d\u0442\u043e\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u0438 \u0432 Telegram, \u0430 \u0437\u0430\u043e\u0434\u043d\u043e \u0438 \u043d\u0430 e-mail.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/627\/887\/38e\/62788738e2520959c3ce0151254ee01e.png\" alt=\"\" title=\"\" width=\"666\" height=\"231\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/627\/887\/38e\/62788738e2520959c3ce0151254ee01e.png\"\/><\/figure>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/3f0\/57c\/19c\/3f057c19c465ee91050d688de06b2d5a.png\" width=\"445\" height=\"232\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3f0\/57c\/19c\/3f057c19c465ee91050d688de06b2d5a.png\"\/><\/figure>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0432\u0430\u0436\u043d\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u043b\u043e\u0433 \u0443\u0436\u0435 \u0441\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0446\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0437\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a\u0443. \u0425\u043e\u0441\u0442\u043d\u0435\u0439\u043c\u044b \u0434\u0430\u044e\u0442 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043e \u0442\u043e\u043f\u043e\u043b\u043e\u0433\u0438\u0438 \u0441\u0435\u0442\u0438, \u0430 \u043b\u043e\u0433\u0438\u043d\u044b \u044e\u0437\u0435\u0440\u043e\u0432 \u043f\u043e\u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u0438 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0441\u043f\u0438\u0441\u043a\u043e\u0432 \u0434\u043b\u044f \u0431\u0440\u0443\u0442\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u0430\u0436\u0435 \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u0432\u0435\u0448\u0430\u0435\u043c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e. \u0417\u0430\u043e\u0434\u043d\u043e \u0432 \u043f\u0440\u043e\u0444\u0438\u043b\u0435 \u044e\u0437\u0435\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0432\u0435\u0441\u0438\u0442\u044c telegram id \u0438 \u043f\u043e\u0447\u0442\u0443, \u043a\u0443\u0434\u0430 \u043b\u043e\u0433\u0438 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u0418\u043b\u0438 \u043d\u0435 \u0432\u0435\u0448\u0430\u0442\u044c, \u044d\u0442\u043e \u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e. \u0420\u0430\u0437\u0443\u043c\u043d\u044b\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c \u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u0432\u044b\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441 \u0441 \u043b\u043e\u0433\u0430\u043c\u0438 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442, \u043e\u0441\u0442\u0430\u0432\u0438\u0432 \u0434\u043e\u0441\u0442\u0443\u043f \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0437 \u043a\u043e\u0440\u043f\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u0441\u0435\u0442\u0438.<\/p>\n<p>\u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u0437\u0430\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0432\u0441\u0451, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0432 Docker \u0438 \u043f\u0440\u0438\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u0435\u043c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0431\u0430\u0437\u044b GeoIP \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430.<\/p>\n<p>\u0418\u0442\u043e\u0433 \u0432\u044b\u0448\u0435\u043b, \u043f\u043e \u043c\u043e\u0435\u043c\u0443 \u043c\u043d\u0435\u043d\u0438\u044e, \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043d\u0435\u043f\u043b\u043e\u0445\u0438\u043c. \u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0432\u0430\u0442\u044c \u0430\u043d\u043e\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u0438 \u0440\u0435\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u043d\u0435\u0451. \u0423\u0441\u043f\u0435\u0448\u043d\u043e \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u043d\u0430\u044f \u0437\u0430\u0440\u0430\u0437\u0430 \u2014 \u044d\u0442\u043e \u0443\u0436\u0435 \u043d\u0430\u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0443 \u043e\u0431\u0435\u0437\u0432\u0440\u0435\u0436\u0435\u043d\u043d\u0430\u044f \u0437\u0430\u0440\u0430\u0437\u0430.<\/p>\n<p>\u041f\u0440\u043e\u0435\u043a\u0442 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d \u043d\u0430 \u0433\u0438\u0442\u0445\u0430\u0431\u0435, <a href=\"https:\/\/github.com\/PressXToWin\/gryffine-server\/\" rel=\"noopener noreferrer nofollow\">\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c<\/a>, <a href=\"https:\/\/github.com\/PressXToWin\/gryffine-client\/\" rel=\"noopener noreferrer nofollow\">\u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0430\u044f \u0447\u0430\u0441\u0442\u044c<\/a>. <\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/771574\/\"> https:\/\/habr.com\/ru\/articles\/771574\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041a\u0430\u043a-\u0442\u043e \u0440\u0430\u0437 \u043e\u0434\u0438\u043d \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u0439 \u0441\u0438\u0441\u0430\u0434\u043c\u0438\u043d \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u043b\u0441\u044f \u043c\u043d\u0435 \u043d\u0430 \u0436\u0438\u0437\u043d\u044c \u0441\u0443\u0440\u043e\u0432\u0443\u044e. \u041e\u043d \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u043b \u043e\u0431 \u043e\u0434\u043d\u043e\u043c \u0438\u043d\u0446\u0438\u0434\u0435\u043d\u0442\u0435 \u0432 \u0435\u0433\u043e \u043a\u043e\u043d\u0442\u043e\u0440\u0435. \u0421\u0442\u043e\u0438\u0442 \u043e\u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043a\u043e\u043d\u0442\u043e\u0440\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0438 \u0442\u0430\u043a\u043e\u0439 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u043a\u0430\u043a \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442 \u043f\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0442\u0430\u043c \u043d\u0435\u0442. \u0418\u043d\u0446\u0438\u0434\u0435\u043d\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0434\u043e \u0431\u0430\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u0421\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u043b\u0438 \u0430\u043d\u043e\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u043d\u0430 \u043b\u0438\u043d\u0443\u043a\u0441\u043e\u0432\u044b\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445. \u041f\u043e\u0434\u043e\u0437\u0440\u0435\u043d\u0438\u044f \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u043b\u0438\u0441\u044c \u0432\u044b\u0432\u043e\u0434\u043e\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u044b who, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043a\u0430\u0437\u0430\u043b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u043e ssh \u0441 \u043f\u0440\u043e\u043a\u0441\u0438-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0441 IP \u043e\u0434\u043d\u043e\u0439 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0439, \u043d\u043e \u043e\u0447\u0435\u043d\u044c \u0433\u043e\u0440\u0434\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u044b. \u0414\u0430\u043b\u044c\u0448\u0435 \u0431\u044b\u043b\u043e \u0442\u043e, \u0447\u0442\u043e \u0438 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043e \u0432 \u0442\u0430\u043a\u0438\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f\u0445, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e: \u0441\u043c\u0435\u043d\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u044b, \u043f\u043e\u043d\u044f\u0442\u044c \u043e\u0442\u043a\u0443\u0434\u0430 \u0437\u0430\u0440\u0430\u0437\u0430 \u043f\u043e \u0441\u0435\u0442\u0438 \u043f\u043e\u0448\u043b\u0430, \u0438 \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u043d\u0430 \u0434\u0435\u043b\u0430\u043b\u0430. \u0414\u043e\u0441\u0442\u0443\u043f\u044b \u0441\u043c\u0435\u043d\u0438\u043b\u0438, \u0430 \u0432\u043e\u0442 \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u0435\u0437\u043b\u0438 \u0432 \u043b\u043e\u0433\u0438, \u0441 \u0443\u0434\u0438\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b, \u0447\u0442\u043e \u043e\u043d\u0438 \u0443\u0436\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u043d\u0435\u0439 \u043a\u0430\u043a \u043f\u0438\u0448\u0443\u0442\u0441\u044f \u0432 \/dev\/null, \u0442\u043e \u0435\u0441\u0442\u044c \u0443 \u0437\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a\u0430 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0431\u044b\u043b root-\u0434\u043e\u0441\u0442\u0443\u043f. \u041f\u043e\u0437\u0436\u0435 \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u0438, \u0447\u0442\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u043e\u0439 \u0431\u044b\u043b\u0430 \u0443\u0442\u0435\u0447\u043a\u0430 \u043f\u0430\u0440\u043e\u043b\u044f \u043e\u0442 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u043e\u0432 \u0441 \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c \u043a sudo.<\/p>\n<p>\u0418\u0441\u0442\u043e\u0440\u0438\u044f, \u0432 \u043e\u0431\u0449\u0435\u043c-\u0442\u043e, \u0442\u0438\u043f\u0438\u0447\u043d\u0430\u044f, \u0442\u044b\u0441\u044f\u0447\u0438 \u0442\u0430\u043a\u0438\u0445. \u041d\u043e \u043c\u0435\u043d\u044f \u043e\u043d\u0430 \u0437\u0430\u0446\u0435\u043f\u0438\u043b\u0430 \u0438 \u043f\u043e\u0431\u0443\u0434\u0438\u043b\u0430 \u0437\u0430\u0434\u0430\u0442\u044c\u0441\u044f \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u043c: \u0430 \u043a\u0430\u043a, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u043e\u0439\u043c\u0430\u0442\u044c \u0445\u0430\u043a\u0435\u0440\u0430 \u0432 \u0442\u043e\u0442 \u0441\u0430\u043c\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442, \u043a\u043e\u0433\u0434\u0430 \u043e\u043d \u043f\u043e\u043f\u0430\u043b \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0432\u043f\u0435\u0440\u0432\u044b\u0435 \u0438 \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043c \u0437\u0430\u043a\u0440\u0435\u043f\u0438\u0442\u044c\u0441\u044f? \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 enterprise-\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0430\u0443\u0434\u0438\u0442\u0430 \u0438 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0432\u0445\u043e\u0434\u0430 \u043d\u0430 \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u0443\u044e \u043c\u0430\u0448\u0438\u043d\u0443, \u043d\u043e \u0434\u0430\u0436\u0435 \u043a\u0440\u0443\u043f\u043d\u044b\u0439 \u0431\u0438\u0437\u043d\u0435\u0441 \u0441 \u043d\u0435\u043e\u0445\u043e\u0442\u043e\u0439 \u0442\u0440\u0430\u0442\u0438\u0442\u0441\u044f \u043d\u0430 \u0438\u043d\u0444\u043e\u0431\u0435\u0437. \u041d\u0435 \u0433\u043e\u0432\u043e\u0440\u044f \u0443\u0436\u0435 \u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043a\u043e\u043d\u0442\u043e\u0440\u0430\u0445 \u0441 IT-\u043e\u0442\u0434\u0435\u043b\u043e\u043c \u0432 3,5 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430. \u0411\u0443\u0434\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0441\u0451 \u0441\u0430\u043c\u0438, \u0431\u043b\u0430\u0433\u043e \u0432 \u043b\u0438\u043d\u0443\u043a\u0441\u0430\u0445 \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0435\u0441\u0442\u044c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438.<\/p>\n<p><abbr class=\"habraabbr\" title=\"Pluggable Authentication Modules, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438\" data-title=\"&lt;p>\u0438\u043a\u0430\u0446\u0438\u0438&#187; data-title=&#187;&lt;p>Pluggable Authentication Modules, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438&lt;\/p>&#187; data-abbr=&#187;PAM&#187;>PAM<\/abbr> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432\u043e \u0432\u0441\u0435\u0445 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 *nix-like \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445. <a href=\"https:\/\/wiki.archlinux.org\/title\/PAM_(%D0%A0%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9)\" rel=\"noopener noreferrer nofollow\">\u0410\u0440\u0447-\u0432\u0438\u043a\u0438<\/a> \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430\u043c, \u0447\u0442\u043e PAM \u2014 \u044d\u0442\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0434\u043b\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435. PAM \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043e\u0442 \u0441\u0445\u0435\u043c\u044b \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u0412\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u044e\u0442\u0441\u044f \u043c\u043e\u0434\u0443\u043b\u0438 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u041a\u0430\u043a\u043e\u0439 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u043c\u043e\u0434\u0443\u043b\u044c \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d, \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438 \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u043d\u0430 \u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u0435 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430.<\/p>\n<p>\u041f\u0440\u043e\u0449\u0435 \u0433\u043e\u0432\u043e\u0440\u044f, \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f PAM \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u0434\u0432\u0443\u0445\u0444\u0430\u043a\u0442\u043e\u0440\u043d\u043e\u0439 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u043d\u0443 \u0438\u043b\u0438 \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435. PAM \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 Linux-\u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445, \u043d\u043e \u0438 \u0442\u0430\u043a\u0436\u0435 \u0432 BSD \u0438 MacOS. \u041d\u043e \u0440\u0430\u0437 \u0443\u0436 \u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043f\u0440\u043e Linux, \u043d\u0430 \u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0438 \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c.<\/p>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 PAM \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0430\u0445, \u043b\u0435\u0436\u0430\u0449\u0438\u0445 \u0432 \/etc\/pam.conf \u0438 \/etc\/pam.d\/. \u0422\u0443\u0434\u0430 \u043c\u044b \u0438 \u0432\u0437\u0433\u043b\u044f\u043d\u0435\u043c.<\/p>\n<details class=\"spoiler\">\n<summary>\/etc\/pam.d\/login<\/summary>\n<div class=\"spoiler__content\">\n<pre><code># # The PAM configuration file for the Shadow `login' service #  # Enforce a minimal delay in case of failure (in microseconds). # (Replaces the `FAIL_DELAY' setting from login.defs) # Note that other modules may require another minimal delay. (for example, # to disable any delay, you should add the nodelay option to pam_unix) auth       optional   pam_faildelay.so  delay=3000000  # Outputs an issue file prior to each login prompt (Replaces the # ISSUE_FILE option from login.defs). Uncomment for use # auth       required   pam_issue.so issue=\/etc\/issue  # Disallows other than root logins when \/etc\/nologin exists # (Replaces the `NOLOGINS_FILE' option from login.defs) auth       requisite  pam_nologin.so  # SELinux needs to be the first session rule. This ensures that any # lingering context has been cleared. Without this it is possible # that a module could execute code in the wrong domain. # When the module is present, \"required\" would be sufficient (When SELinux # is disabled, this returns success.) session [success=ok ignore=ignore module_unknown=ignore default=bad] pam_selinux.so close  # Sets the loginuid process attribute session    required     pam_loginuid.so  # Prints the message of the day upon successful login. # (Replaces the `MOTD_FILE' option in login.defs) # This includes a dynamically generated part from \/run\/motd.dynamic # and a static (admin-editable) part from \/etc\/motd. session    optional   pam_motd.so motd=\/run\/motd.dynamic session    optional   pam_motd.so noupdate  # SELinux needs to intervene at login time to ensure that the process # starts in the proper default security context. Only sessions which are # intended to run in the user's context should be run after this. # pam_selinux.so changes the SELinux context of the used TTY and configures # SELinux in order to transition to the user context with the next execve() # call. session [success=ok ignore=ignore module_unknown=ignore default=bad] pam_selinux.so open # When the module is present, \"required\" would be sufficient (When SELinux # is disabled, this returns success.)  # This module parses environment configuration file(s) # and also allows you to use an extended config # file \/etc\/security\/pam_env.conf. #  # parsing \/etc\/environment needs \"readenv=1\" session       required   pam_env.so readenv=1 # locale variables are also kept into \/etc\/default\/locale in etch # reading this file *in addition to \/etc\/environment* does not hurt session       required   pam_env.so readenv=1 envfile=\/etc\/default\/locale  # Standard Un*x authentication. @include common-auth  # This allows certain extra groups to be granted to a user # based on things like time of day, tty, service, and user. # Please edit \/etc\/security\/group.conf to fit your needs # (Replaces the `CONSOLE_GROUPS' option in login.defs) auth       optional   pam_group.so  # Uncomment and edit \/etc\/security\/time.conf if you need to set # time restraint on logins. # (Replaces the `PORTTIME_CHECKS_ENAB' option from login.defs # as well as \/etc\/porttime) # account    requisite  pam_time.so  # Uncomment and edit \/etc\/security\/access.conf if you need to # set access limits. # (Replaces \/etc\/login.access file) # account  required       pam_access.so  # Sets up user limits according to \/etc\/security\/limits.conf # (Replaces the use of \/etc\/limits in old login) session    required   pam_limits.so  # Prints the last login info upon successful login # (Replaces the `LASTLOG_ENAB' option from login.defs) session    optional   pam_lastlog.so  # Prints the status of the user's mailbox upon successful login # (Replaces the `MAIL_CHECK_ENAB' option from login.defs).  # # This also defines the MAIL environment variable # However, userdel also needs MAIL_DIR and MAIL_FILE variables # in \/etc\/login.defs to make sure that removing a user  # also removes the user's mail spool file. # See comments in \/etc\/login.defs session    optional   pam_mail.so standard  # Create a new session keyring. session    optional   pam_keyinit.so force revoke  # Standard Un*x account and session @include common-account @include common-session @include common-password<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0434\u043b\u044f \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438\u043b\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439. \u0421\u0442\u0440\u043e\u043a\u0430 \u0432 \u0444\u0430\u0439\u043b\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u0434\u043d\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e.<\/p>\n<p>\u041a\u0430\u0436\u0434\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0442\u0440\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430: \u0442\u0438\u043f \u043c\u043e\u0434\u0443\u043b\u044f, control_flag \u0438 \u0438\u043c\u044f \u043c\u043e\u0434\u0443\u043b\u044f. \u041d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0435\u0441 \u0434\u043b\u044f \u043d\u0430\u0441 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u043c\u043e\u0434\u0443\u043b\u0438 \u0442\u0438\u043f\u0430 &#171;auth&#187;, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u043d\u0438 \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0442 \u0437\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e. Control_flag \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043c\u043e\u0434\u0443\u043b\u044f \u0438 \u043c\u043e\u0436\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>requisite (\u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439) \u2014 \u0435\u0441\u043b\u0438 \u043c\u043e\u0434\u0443\u043b\u044c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442, \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0432 \u0446\u0435\u043f\u043e\u0447\u043a\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f, \u0438 \u0437\u0430\u043f\u0440\u043e\u0441 \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u0435\u0442\u0441\u044f. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0435\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e \u043e\u0442\u0432\u0435\u0440\u0433\u0430\u0435\u0442\u0441\u044f, \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f.<\/p>\n<\/li>\n<li>\n<p>required (\u0442\u0440\u0435\u0431\u0443\u0435\u043c\u044b\u0439) \u2014 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e requisite: \u043f\u0440\u0438 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u043c \u043e\u0442\u0432\u0435\u0442\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0432 \u0446\u0435\u043f\u043e\u0447\u043a\u0435. \u041e\u0442\u043b\u0438\u0447\u0438\u0435 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0440\u0438 \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u043c \u043e\u0442\u0432\u0435\u0442\u0435 \u0446\u0435\u043f\u043e\u0447\u043a\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443, \u043d\u043e \u0437\u0430\u043f\u0440\u043e\u0441 \u043e\u0442\u043a\u043b\u043e\u043d\u044f\u0435\u0442\u0441\u044f.<\/p>\n<\/li>\n<li>\n<p>sufficient (\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u044b\u0439) \u2014 \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441, \u0435\u0441\u043b\u0438 \u043d\u0438 \u043e\u0434\u043d\u0430 \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a \u0432 \u0446\u0435\u043f\u043e\u0447\u043a\u0435 \u043d\u0435 \u0432\u0435\u0440\u043d\u0443\u043b\u0430 \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u0433\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442\u0441\u044f.<\/p>\n<\/li>\n<li>\n<p>optional (\u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439) \u2014 \u043c\u043e\u0434\u0443\u043b\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0441\u0432\u043e\u044e \u0440\u0430\u0431\u043e\u0442\u0443, \u043d\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0435 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f.<\/p>\n<\/li>\n<\/ul>\n<p>\u041e\u0431\u0449\u0438\u0435 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0432 common-auth, \u0432\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u0438 \u0442\u0443\u0434\u0430 \u0442\u043e\u0436\u0435.<\/p>\n<details class=\"spoiler\">\n<summary>\/etc\/pam.d\/common-auth<\/summary>\n<div class=\"spoiler__content\">\n<pre><code># # \/etc\/pam.d\/common-auth - authentication settings common to all services # # This file is included from other service-specific PAM config files, # and should contain a list of the authentication modules that define # the central authentication scheme for use on the system # (e.g., \/etc\/shadow, LDAP, Kerberos, etc.).  The default is to use the # traditional Unix authentication mechanisms. # # As of pam 1.0.1-6, this file is managed by pam-auth-update by default. # To take advantage of this, it is recommended that you configure any # local modules either before or after the default block, and use # pam-auth-update to manage selection of other modules.  See # pam-auth-update(8) for details.  # here are the per-package modules (the \"Primary\" block) auth[success=1 default=ignore]pam_unix.so nullok # here's the fallback if no module succeeds authrequisitepam_deny.so # prime the stack with a positive return value if there isn't one already; # this avoids us returning an error just because nothing sets a success code # since the modules above will each just jump around authrequiredpam_permit.so # and here are more per-package modules (the \"Additional\" block) # end of pam-auth-update config<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0427\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442: \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043c\u043e\u0434\u0443\u043b\u044c pam_unix.so, \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u043a\u0438 pam_unix.so \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f pam_deny.so \u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0443\u0441\u043f\u0435\u0445\u0430 pam_unix.so \u0441\u043b\u0435\u0434\u0443\u0435\u0442  \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0440\u043e\u0447\u043a\u0438, \u0442\u043e \u0435\u0441\u0442\u044c pam_deny.so \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f pam_permit.so.<\/p>\n<p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e. \u0412 \u043e\u0434\u0438\u043d \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0437\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0440\u0443\u0442\u0430, \u0441\u0435\u0440\u0432\u0435\u0440 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0435\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c. \u0412\u0435\u0440\u0438\u0442\u044c \u043b\u043e\u0433\u0430\u043c \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043c\u044b \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043c\u043e\u0436\u0435\u043c, \u0445\u0430\u043a\u0435\u0440 \u0438\u043c\u0438 \u043c\u043e\u0436\u0435\u0442 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043f\u0440\u0438\u0447\u0451\u043c \u0445\u0430\u043a\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0436\u0435 \u0432\u044b\u0448\u0435\u043b \u0438\u0437 \u0448\u043a\u043e\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430 \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u043e \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u043f\u043e\u0442\u0435\u0440\u0435\u0432 \u043b\u043e\u0433\u0438 \u0441 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u043c\u0438 (\u0443\u0441\u043f\u0435\u0448\u043d\u044b\u043c\u0438 \u0438 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c) \u043f\u043e\u043f\u044b\u0442\u043a\u0430\u043c\u0438 \u043f\u0440\u043e\u0439\u0442\u0438 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u0447\u0442\u043e \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442. \u041f\u0435\u0440\u0438\u043c\u0435\u0442\u0440\u043e\u043c \u0430\u0442\u0430\u043a\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u0435\u0440\u0432\u0435\u0440, \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-359186","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/359186","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=359186"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/359186\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=359186"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=359186"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=359186"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}