{"id":345789,"date":"2023-02-22T21:05:30","date_gmt":"2023-02-22T21:05:30","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=345789"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2023-02-22T21:05:30","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=345789","title":{"rendered":"<span>\u0421\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0432\u0432\u0435\u0441\u0442\u0438 Linux \u0432 \u0434\u043e\u043c\u0435\u043d<\/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>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442!<\/p>\n<p>\u0422\u0435\u0440\u043c\u0438\u043d Microsoft Active Directory Domain Services \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0440\u0430\u0437\u0443 \u0443\u0442\u043e\u0447\u043d\u044e, \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0435\u0442 \u043f\u0440\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0434\u043e\u043c\u0435\u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \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. \u0422\u043e \u0435\u0441\u0442\u044c \u0432 \u0444\u0438\u043d\u0430\u043b\u0435, \u043d\u0443\u0436\u043d\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043b\u044e\u0431\u043e\u043c\u0443 \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u0443 \u043f\u0440\u0435\u0434\u043f\u0440\u0438\u044f\u0442\u0438\u044f \u0441\u0435\u0441\u0442\u044c \u0437\u0430 \u043b\u044e\u0431\u0443\u044e \u0440\u0430\u0431\u043e\u0447\u0443\u044e \u0441\u0442\u0430\u043d\u0446\u0438\u044e Linux, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u0432\u043e\u0439 \u0434\u043e\u043c\u0435\u043d\u043d\u044b\u0439 \u043b\u043e\u0433\u0438\u043d \u0438 \u043f\u0430\u0440\u043e\u043b\u044c.<\/p>\n<p>\u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 Windows 2000 Server \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 \u0434\u043e\u043c\u0435\u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b Kerberos, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0439 \u0435\u0449\u0435 \u0432 80-\u0445 \u0433\u043e\u0434\u0430\u0445 \u043f\u0440\u043e\u0448\u043b\u043e\u0433\u043e \u0441\u0442\u043e\u043b\u0435\u0442\u0438\u044f, \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e, \u0418\u041c\u0425\u041e, \u044f\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043e\u0442\u043b\u0438\u0447\u043d\u043e\u0433\u043e \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u043d\u043e\u0433\u043e\u00a0<a href=\"https:\/\/royallib.com\/book\/levi_stiven\/hakeri_geroi_kompyuternoy_revolyutsii.html\" rel=\"noopener noreferrer nofollow\">\u0445\u0430\u043a\u0430, \u0432 \u0445\u043e\u0440\u043e\u0448\u0435\u043c (\u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u043c:) \u0441\u043c\u044b\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430<\/a>. \u0412 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u0435\u0441\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u044b, \u0430 \u0441\u0435\u0439\u0447\u0430\u0441 \u043d\u0430\u0434\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 \u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0438\u0437 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043d\u0435 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043a Microsoft Active Directory<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/117\/a65\/558\/117a655581e4c88d9a29dfd1a3b41869.PNG\" width=\"340\" height=\"191\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0418\u0442\u0430\u043a, \u043d\u0430 \u043f\u0440\u0435\u0434\u043f\u0440\u0438\u044f\u0442\u0438\u0438 \u0443\u0436\u0435 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0434\u043e\u043c\u0435\u043d\u0430, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u0435\u0435 \u0432\u0441\u0435\u0433\u043e &#8212; Microsoft Active Directory \u0438 \u043f\u0435\u0440\u0435\u0434 \u043d\u0430\u043c\u0438 &#8212; \u0440\u0430\u0431\u043e\u0447\u0430\u044f \u0441\u0442\u0430\u043d\u0446\u0438\u044f Linux (\u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0431\u0443\u0434\u0443\u0442 \u0434\u043b\u044f Debian, \u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0431\u0443\u0434\u0435\u0442 \u0438 \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u0430\u0445 \u0438, \u0434\u0430\u0436\u0435, \u0432 \u043c\u043e\u0435\u0439 \u043b\u044e\u0431\u0438\u043c\u043e\u0439 FreeBSD:). \u041a\u0430\u043a \u0432\u0432\u0435\u0441\u0442\u0438 \u0435\u0435 \u0432 \u0434\u043e\u043c\u0435\u043d?<\/p>\n<p>\u0414\u0430 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e:<\/p>\n<pre><code>student@debian:~$ sudo apt install krb5-user -y<\/code><\/pre>\n<p>\u0412 Debian \u0434\u0430\u0436\u0435 \u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043d\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0438, \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0443\u043a\u0430\u0436\u0438\u0442\u0435 \u044d\u0442\u0438 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 Kerberos \u043a\u043b\u0438\u0435\u043d\u0442\u0430 (\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0445)<\/p>\n<pre><code>student@debian:~$ sudo nano \/etc\/krb5.conf<\/code><\/pre>\n<pre><code>[libdefaults]         default_realm = CORP.RU<\/code><\/pre>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e CORP.RU \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0438\u043c\u044f \u0434\u043e\u043c\u0435\u043d\u0430 (Kerberos \u0441\u0444\u0435\u0440\u044b) \u0412\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0435\u0434\u043f\u0440\u0438\u044f\u0442\u0438\u044f<\/p>\n<p>\u0418 \u0432\u0441\u0435, \u043c\u043e\u0436\u043d\u043e \u201c\u0432\u0445\u043e\u0434\u0438\u0442\u044c\u201d \u0432 \u0434\u043e\u043c\u0435\u043d:<\/p>\n<pre><code>student@debian:~$ kinit ivanovii Password for ivanovii@CORP.RU:  student@debian:~$ klist Ticket cache: FILE:\/tmp\/krb5cc_1000 Default principal: ivanovii@CORP.RU Valid starting       Expires              Service principal 02\/22\/2023 00:09:13  02\/22\/2023 10:09:13  krbtgt\/CORP.RU@CORP.RU renew until 02\/23\/2023 00:09:09<\/code><\/pre>\n<p>ivanovii &#8212; \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432 \u0434\u043e\u043c\u0435\u043d\u0435 \u043b\u043e\u0433\u0438\u043d \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u0435 \u0435\u0433\u043e \u043d\u0430 \u0442\u043e\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0435\u0441\u0442\u044c \u0443 \u0412\u0430\u0441, \u043c\u043e\u0436\u043d\u043e, \u0434\u0430\u0436\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Administrator. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u043e\u043c\u0430\u043d\u0434\u044b kinit \u0431\u044b\u043b\u0430 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u0435\u043d\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d Ticket-Granting Ticket (TGT) \u201c\u0431\u0438\u043b\u0435\u0442 \u043d\u0430 \u0432\u044b\u0434\u0430\u0447\u0443 \u0431\u0438\u043b\u0435\u0442\u043e\u0432\u201d, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439, \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c, \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0431\u0438\u043b\u0435\u0442\u044b \u043d\u0430 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0432 \u0434\u043e\u043c\u0435\u043d\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044f \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044e \u0435\u0434\u0438\u043d\u043e\u0433\u043e \u0432\u0445\u043e\u0434\u0430 &#8212; single sign-on (SSO).<\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u044e \ud83d\ude42<\/p>\n<p>\u041f\u043e\u0441\u0442\u043e\u0439\u0442\u0435, \u043d\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u043e\u0441\u043d\u0430\u0441\u0442\u043a\u0435 \u201cActive Directory Users and Computers\u201d \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u0441\u0442\u0430\u043d\u0446\u0438\u0438 Linux \u043d\u0435 \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c, \u043a\u0430\u043a \u0436\u0435 \u0442\u0430\u043a? \u0414\u0430, \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0434\u043e\u043c\u0435\u043d\u0430 \u043f\u043e \u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0437\u043d\u0430\u0435\u0442 \u043e \u043d\u0430\u0448\u0435\u0439 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u0441\u0442\u0430\u043d\u0446\u0438\u0438, \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442, \u044d\u0442\u043e \u043d\u0430\u0448\u0430 \u0440\u0430\u0431\u043e\u0447\u0430\u044f \u0441\u0442\u0430\u043d\u0446\u0438\u044f, \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0443 default_realm = CORP.RU \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c SRV \u0437\u0430\u043f\u0438\u0441\u044f\u043c \u0432\u00a0DNS<\/p>\n<pre><code>student@debian:~$ nslookup -q=SRV _kerberos._udp.corp.ru ... kdc.corp.ru    internet address = A.B.C.D<\/code><\/pre>\n<p>\u0437\u043d\u0430\u0435\u0442 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0434\u043e\u043c\u0435\u043d\u0430, \u0438 \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0435\u0433\u043e Kerberos \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439. \u0414\u043b\u044f \u0447\u0435\u0433\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f Linux \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0432 Active Directory \u0438 \u043a\u0430\u043a \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c &#8212; \u0442\u0435\u043c\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438, \u0430 \u0441\u0435\u0439\u0447\u0430\u0441 \u0432\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043a \u043d\u0430\u0448\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0435 &#8212; \u0432\u0445\u043e\u0434 \u0434\u043e\u043c\u0435\u043d\u043d\u043e\u0439 \u0443\u0447\u0435\u0442\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u044c\u044e \u0432 Linux \u0441\u0438\u0441\u0442\u0435\u043c\u0443<\/p>\n<p>\u0417\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \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 \u043f\u0440\u0438 \u0432\u0445\u043e\u0434\u0435 \u0432 Linux \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 PAM (Pluggable Authentication Modules) \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u044f \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b \u0432\u00a0<a href=\"https:\/\/habr.com\/ru\/post\/713582\" rel=\"noopener noreferrer nofollow\">\u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/a>. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043c\u043e\u0434\u0443\u043b\u044c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0439 Kerberos \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e:<\/p>\n<pre><code>student@debian:~$ sudo apt install libpam-krb5 -y<\/code><\/pre>\n<p>\u0412 Debian \u043d\u043e\u0432\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e PAM \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u0441\u043f\u0435\u0440\u0432\u0430 \u043b\u043e\u0433\u0438\u043d\/\u043f\u0430\u0440\u043e\u043b\u044c \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c\u0441\u044f \u0432 Kerberos, \u0438, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u0443\u0434\u0430\u0447\u0438, \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0431\u0430\u0437\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439:<\/p>\n<pre><code>student@debian:~$ less \/etc\/pam.d\/common-auth<\/code><\/pre>\n<pre><code>... auth    [success=2 default=ignore]      pam_krb5.so minimum_uid=1000 auth    [success=1 default=ignore]      pam_unix.so nullok try_first_pas ...<\/code><\/pre>\n<p>\u043e\u0434\u043d\u0430\u043a\u043e, \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u0432\u043e\u0439\u0442\u0438 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0434\u043e\u043c\u0435\u043d\u043d\u044b\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u0441\u044f \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u043e:<\/p>\n<pre><code>student@debian:~$ sudo login debian login: ivanovii Password: Authentication failure<\/code><\/pre>\n<p>\u0430 \u0432 \u0436\u0443\u0440\u043d\u0430\u043b\u0435 \u0432\u0438\u0434\u043d\u0430 \u043f\u0440\u0438\u0447\u0438\u043d\u0430:<\/p>\n<pre><code>student@debian:~$ sudo tail \/var\/log\/auth.log ... Feb 22 01:18:43 debian login[1587]: pam_krb5(login:auth): user ivanovii authenticated as ivanovii@CORP.RU Feb 22 01:18:43 debian login[1587]: pam_unix(login:account): could not identify user (from getpwnam(ivanovii)) ...<\/code><\/pre>\n<p>\u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0448\u043b\u0430 \u0443\u0441\u043f\u0435\u0448\u043d\u043e, \u043d\u043e \u0434\u0430\u043b\u044c\u0448\u0435, \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0437\u043d\u0430\u0435\u0442 \u043e \u043d\u0430\u0448\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435 (\u043d\u0438 UID, \u043d\u0438 GID \u043d\u0438 \u043f\u0440\u043e\u0447\u0438\u0445 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432)<\/p>\n<pre><code>$ id ivanovii id: \u2018ivanovii\u2019: no such user<\/code><\/pre>\n<p>\u0412\u043e\u0442 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043f\u043e\u0434\u043e\u0448\u043b\u0438 \u043a \u044d\u0442\u0430\u043f\u0443, \u0440\u0430\u0434\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0438\u0441\u0430\u043b\u0430\u0441\u044c \u0441\u0442\u0430\u0442\u044c\u044f:)<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0430\u0447\u0430\u0442\u044c \u0438\u0441\u043a\u0430\u0442\u044c \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438, \u0442\u043e, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0412\u044b \u0443\u0437\u043d\u0430\u0435\u0442\u0435 \u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 Name Service Switch (NSS) \u0438 \u043c\u043e\u0434\u0443\u043b\u044f\u0445 LDAP, WinBIND \u0438\u043b\u0438 SSSD \u0434\u043b\u044f \u043d\u0435\u0435. \u041d\u043e \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u2026 \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0443\u0447\u0435\u0442\u043d\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c \u043f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438?<\/p>\n<p>\u041e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 PAM \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0442\u044c \u0441\u0432\u043e\u0438\u043c\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u043c\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043c\u043e\u0434\u0443\u043b\u044c pam_script. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0435\u0433\u043e \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443:<\/p>\n<pre><code>student@debian:~$ sudo apt install libpam-script -y<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u0430\u0432\u0442\u043e\u0440\u044b \u043f\u0430\u043a\u0435\u0442\u0430 \u0434\u043b\u044f Debian \u043d\u0435 \u0443\u0433\u0430\u0434\u0430\u043b\u0438 \u043d\u0430\u0448 \u0437\u0430\u043c\u044b\u0441\u0435\u043b, \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0438\u0432 \u043c\u043e\u0434\u0443\u043b\u0438 \u0432 \u0442\u0430\u043a\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435:<\/p>\n<pre><code>student@debian:~$ less \/etc\/pam.d\/common-auth ... auth    [success=3 default=ignore]      pam_krb5.so minimum_uid=1000 auth    sufficient                      pam_script.so auth    [success=1 default=ignore]      pam_unix.so nullok try_first_pass ...<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0447\u0435\u0441\u0442\u043d\u043e, \u0442\u043e \u0442\u0430\u043a\u0430\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0438, \u043d\u043e \u0438 \u043e\u0447\u0435\u043d\u044c \u043d\u0435 \u0445\u043e\u0440\u043e\u0448\u0430 \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438, \u043b\u0435\u0433\u043a\u043e \u0434\u043e\u0432\u0435\u0441\u0442\u0438 \u0435\u0435 \u0434\u043e \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u043a\u043e\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0437\u043d\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u043d \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 root, \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u043f\u0430\u0440\u043e\u043b\u044c \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442 \u043b\u044e\u0431\u043e\u0439 (\u0432\u043e\u0442 \u0437\u0430 \u044d\u0442\u043e \u043b\u044e\u0431\u0438\u043b FreeBSD, \u043e\u043d\u0430 \u0437\u0430 \u043d\u0430\u0441 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u0442:) \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u043f\u043e\u043f\u0440\u0430\u0432\u044c\u0442\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0438\u0432 \u043c\u043e\u0434\u0443\u043b\u0438 \u0442\u0430\u043a:<\/p>\n<pre><code>student@debian:~$ sudo nano \/etc\/pam.d\/common-auth<\/code><\/pre>\n<pre><code>auth    [success=2 default=ignore]      pam_krb5.so minimum_uid=1000 auth    [success=2 default=ignore]      pam_unix.so nullok_secure try_first_pass auth    requisite                       pam_deny.so auth    sufficient                      pam_script.so auth    required                        pam_permit.so<\/code><\/pre>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0443\u0447\u0442\u0451\u043d\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 Kerberos, \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u201c\u043f\u0435\u0440\u0435\u043f\u0440\u044b\u0433\u043d\u0435\u0442\u201d \u0434\u0432\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0448\u0430\u0433\u0430 \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442 \u043c\u043e\u0434\u0443\u043b\u044c pam_script. \u041e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0443\u0447\u0435\u0442\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438, \u0438, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 &#8212; \u0441\u043e\u0437\u0434\u0430\u0441\u0442:<\/p>\n<pre><code>student@debian:~$ sudo nano \/usr\/share\/libpam-script\/pam_script_auth<\/code><\/pre>\n<pre><code>#!\/bin\/bash  id \"$PAM_USER\" &amp;>\/dev\/null || useradd -m -s \/bin\/bash \"$PAM_USER\"<\/code><\/pre>\n<pre><code>student@debian:~$ sudo chmod +x \/usr\/share\/libpam-script\/pam_script_auth<\/code><\/pre>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c:<\/p>\n<pre><code>student@debian:~$ sudo login debian login: ivanovii Password: ... ivanovii@debian:~$ id uid=1001(ivanovii) gid=1001(ivanovii) groups=1001(ivanovii)  ivanovii@debian:~$ klist Ticket cache: FILE:\/tmp\/krb5cc_1001_0zzvqR Default principal: ivanovii@CORP.RU Valid starting       Expires              Service principal 02\/22\/2023 04:14:30  02\/22\/2023 14:14:30  krbtgt\/CORP.RU@CORP.RU renew until 02\/23\/2023 04:14:30<\/code><\/pre>\n<p>\u041d\u0443 \u0432\u043e\u0442 \u0438 \u0432\u0441\u0435, \u043c\u044b \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u0438 TGT \u0443 \u043d\u0430\u0441 \u0432 \u043a\u0430\u0440\u043c\u0430\u043d\u0435:)<\/p>\n<p>\u041e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u043c \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u043e\u043c \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u043e, \u0447\u0442\u043e \u043f\u043e\u0441\u043b\u0435 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0443\u0447\u0451\u0442\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438\u0437 \u0434\u043e\u043c\u0435\u043d\u0430, \u043e\u043d\u0430 \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u043d\u0430 \u0432\u0441\u0435\u0445 \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u0441\u0442\u0430\u043d\u0446\u0438\u044f\u0445, \u0437\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u043b. \u041d\u043e, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u044d\u0442\u0438\u043c\u0438 \u0443\u0447\u0442\u0451\u043d\u043d\u044b\u043c\u0438 \u0437\u0430\u043f\u0438\u0441\u044f\u043c\u0438 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e (\u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0431\u0430\u0437\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043e\u043d\u0438 \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u044b), \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043a\u0430 \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432\u0441\u0435 \u043a\u0430\u043a \u0435\u0441\u0442\u044c.<\/p>\n<p>\u0421\u043f\u0430\u0441\u0438\u0431\u043e, \u0447\u0442\u043e \u0434\u043e\u0447\u0438\u0442\u0430\u043b\u0438 \u0434\u043e \u043a\u043e\u043d\u0446\u0430, \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0431\u044b\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u0441\u0441\u044b\u043b\u043a\u0438, \u0431\u0443\u0434\u0443 \u0440\u0430\u0434 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c, \u0434\u043e \u043d\u043e\u0432\u044b\u0445 \u0432\u0441\u0442\u0440\u0435\u0447!<\/p>\n<p>\u0421\u0441\u044b\u043b\u043a\u0438:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/bestprogrammer.ru\/izuchenie\/kerberos-za-5-minut-znakomstvo-s-setevoj-autentifikatsiej\" rel=\"noopener noreferrer nofollow\">Kerberos \u0437\u0430 5 \u043c\u0438\u043d\u0443\u0442: \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0441 \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0435\u0439<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/youtu.be\/S7QOkcznEVY\" rel=\"noopener noreferrer nofollow\">\u0417\u0430\u0447\u0435\u043c \u0432\u0432\u043e\u0434\u0438\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u044b Linux \u0432 \u0434\u043e\u043c\u0435\u043d Microsoft?<\/a><\/p>\n<\/li>\n<\/ul>\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\/post\/718632\/\"> https:\/\/habr.com\/ru\/post\/718632\/<\/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>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442!<\/p>\n<p>\u0422\u0435\u0440\u043c\u0438\u043d Microsoft Active Directory Domain Services \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0440\u0430\u0437\u0443 \u0443\u0442\u043e\u0447\u043d\u044e, \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0435\u0442 \u043f\u0440\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0434\u043e\u043c\u0435\u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \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. \u0422\u043e \u0435\u0441\u0442\u044c \u0432 \u0444\u0438\u043d\u0430\u043b\u0435, \u043d\u0443\u0436\u043d\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043b\u044e\u0431\u043e\u043c\u0443 \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u0443 \u043f\u0440\u0435\u0434\u043f\u0440\u0438\u044f\u0442\u0438\u044f \u0441\u0435\u0441\u0442\u044c \u0437\u0430 \u043b\u044e\u0431\u0443\u044e \u0440\u0430\u0431\u043e\u0447\u0443\u044e \u0441\u0442\u0430\u043d\u0446\u0438\u044e Linux, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u0432\u043e\u0439 \u0434\u043e\u043c\u0435\u043d\u043d\u044b\u0439 \u043b\u043e\u0433\u0438\u043d \u0438 \u043f\u0430\u0440\u043e\u043b\u044c.<\/p>\n<p>\u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 Windows 2000 Server \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 \u0434\u043e\u043c\u0435\u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b Kerberos, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0439 \u0435\u0449\u0435 \u0432 80-\u0445 \u0433\u043e\u0434\u0430\u0445 \u043f\u0440\u043e\u0448\u043b\u043e\u0433\u043e \u0441\u0442\u043e\u043b\u0435\u0442\u0438\u044f, \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e, \u0418\u041c\u0425\u041e, \u044f\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043e\u0442\u043b\u0438\u0447\u043d\u043e\u0433\u043e \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u043d\u043e\u0433\u043e\u00a0<a href=\"https:\/\/royallib.com\/book\/levi_stiven\/hakeri_geroi_kompyuternoy_revolyutsii.html\" rel=\"noopener noreferrer nofollow\">\u0445\u0430\u043a\u0430, \u0432 \u0445\u043e\u0440\u043e\u0448\u0435\u043c (\u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u043c:) \u0441\u043c\u044b\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430<\/a>. \u0412 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u0435\u0441\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u044b, \u0430 \u0441\u0435\u0439\u0447\u0430\u0441 \u043d\u0430\u0434\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 \u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0438\u0437 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043d\u0435 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043a Microsoft Active Directory<\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u0418\u0442\u0430\u043a, \u043d\u0430 \u043f\u0440\u0435\u0434\u043f\u0440\u0438\u044f\u0442\u0438\u0438 \u0443\u0436\u0435 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0434\u043e\u043c\u0435\u043d\u0430, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u0435\u0435 \u0432\u0441\u0435\u0433\u043e &#8212; Microsoft Active Directory \u0438 \u043f\u0435\u0440\u0435\u0434 \u043d\u0430\u043c\u0438 &#8212; \u0440\u0430\u0431\u043e\u0447\u0430\u044f \u0441\u0442\u0430\u043d\u0446\u0438\u044f Linux (\u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0431\u0443\u0434\u0443\u0442 \u0434\u043b\u044f Debian, \u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0431\u0443\u0434\u0435\u0442 \u0438 \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u0430\u0445 \u0438, \u0434\u0430\u0436\u0435, \u0432 \u043c\u043e\u0435\u0439 \u043b\u044e\u0431\u0438\u043c\u043e\u0439 FreeBSD:). \u041a\u0430\u043a \u0432\u0432\u0435\u0441\u0442\u0438 \u0435\u0435 \u0432 \u0434\u043e\u043c\u0435\u043d?<\/p>\n<p>\u0414\u0430 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e:<\/p>\n<pre><code>student@debian:~$ sudo apt install krb5-user -y<\/code><\/pre>\n<p>\u0412 Debian \u0434\u0430\u0436\u0435 \u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043d\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0438, \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0443\u043a\u0430\u0436\u0438\u0442\u0435 \u044d\u0442\u0438 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 Kerberos \u043a\u043b\u0438\u0435\u043d\u0442\u0430 (\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0445)<\/p>\n<pre><code>student@debian:~$ sudo nano \/etc\/krb5.conf<\/code><\/pre>\n<pre><code>[libdefaults]         default_realm = CORP.RU<\/code><\/pre>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e CORP.RU \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0438\u043c\u044f \u0434\u043e\u043c\u0435\u043d\u0430 (Kerberos \u0441\u0444\u0435\u0440\u044b) \u0412\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0435\u0434\u043f\u0440\u0438\u044f\u0442\u0438\u044f<\/p>\n<p>\u0418 \u0432\u0441\u0435, \u043c\u043e\u0436\u043d\u043e \u201c\u0432\u0445\u043e\u0434\u0438\u0442\u044c\u201d \u0432 \u0434\u043e\u043c\u0435\u043d:<\/p>\n<pre><code>student@debian:~$ kinit ivanovii Password for ivanovii@CORP.RU:  student@debian:~$ klist Ticket cache: FILE:\/tmp\/krb5cc_1000 Default principal: ivanovii@CORP.RU Valid starting       Expires              Service principal 02\/22\/2023 00:09:13  02\/22\/2023 10:09:13  krbtgt\/CORP.RU@CORP.RU renew until 02\/23\/2023 00:09:09<\/code><\/pre>\n<p>ivanovii &#8212; \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432 \u0434\u043e\u043c\u0435\u043d\u0435 \u043b\u043e\u0433\u0438\u043d \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u0435 \u0435\u0433\u043e \u043d\u0430 \u0442\u043e\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0435\u0441\u0442\u044c \u0443 \u0412\u0430\u0441, \u043c\u043e\u0436\u043d\u043e, \u0434\u0430\u0436\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Administrator. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u043e\u043c\u0430\u043d\u0434\u044b kinit \u0431\u044b\u043b\u0430 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u0435\u043d\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d Ticket-Granting Ticket (TGT) \u201c\u0431\u0438\u043b\u0435\u0442 \u043d\u0430 \u0432\u044b\u0434\u0430\u0447\u0443 \u0431\u0438\u043b\u0435\u0442\u043e\u0432\u201d, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439, \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c, \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0431\u0438\u043b\u0435\u0442\u044b \u043d\u0430 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0432 \u0434\u043e\u043c\u0435\u043d\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044f \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044e \u0435\u0434\u0438\u043d\u043e\u0433\u043e \u0432\u0445\u043e\u0434\u0430 &#8212; single sign-on (SSO).<\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u044e \ud83d\ude42<\/p>\n<p>\u041f\u043e\u0441\u0442\u043e\u0439\u0442\u0435, \u043d\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u043e\u0441\u043d\u0430\u0441\u0442\u043a\u0435 \u201cActive Directory Users and Computers\u201d \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u0441\u0442\u0430\u043d\u0446\u0438\u0438 Linux \u043d\u0435 \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c, \u043a\u0430\u043a \u0436\u0435 \u0442\u0430\u043a? \u0414\u0430, \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0434\u043e\u043c\u0435\u043d\u0430 \u043f\u043e \u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0437\u043d\u0430\u0435\u0442 \u043e \u043d\u0430\u0448\u0435\u0439 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u0441\u0442\u0430\u043d\u0446\u0438\u0438, \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442, \u044d\u0442\u043e \u043d\u0430\u0448\u0430 \u0440\u0430\u0431\u043e\u0447\u0430\u044f \u0441\u0442\u0430\u043d\u0446\u0438\u044f, \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0443 default_realm = CORP.RU \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c SRV \u0437\u0430\u043f\u0438\u0441\u044f\u043c \u0432\u00a0DNS<\/p>\n<pre><code>student@debian:~$ nslookup -q=SRV _kerberos._udp.corp.ru ... kdc.corp.ru    internet address = A.B.C.D<\/code><\/pre>\n<p>\u0437\u043d\u0430\u0435\u0442 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0434\u043e\u043c\u0435\u043d\u0430, \u0438 \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0435\u0433\u043e Kerberos \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439. \u0414\u043b\u044f \u0447\u0435\u0433\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f Linux \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0432 Active Directory \u0438 \u043a\u0430\u043a \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c &#8212; \u0442\u0435\u043c\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438, \u0430 \u0441\u0435\u0439\u0447\u0430\u0441 \u0432\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043a \u043d\u0430\u0448\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0435 &#8212; \u0432\u0445\u043e\u0434 \u0434\u043e\u043c\u0435\u043d\u043d\u043e\u0439 \u0443\u0447\u0435\u0442\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u044c\u044e \u0432 Linux \u0441\u0438\u0441\u0442\u0435\u043c\u0443<\/p>\n<p>\u0417\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \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 \u043f\u0440\u0438 \u0432\u0445\u043e\u0434\u0435 \u0432 Linux \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 PAM (Pluggable Authentication Modules) \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u044f \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b \u0432\u00a0<a href=\"https:\/\/habr.com\/ru\/post\/713582\" rel=\"noopener noreferrer nofollow\">\u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/a>. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043c\u043e\u0434\u0443\u043b\u044c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0439 Kerberos \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e:<\/p>\n<pre><code>student@debian:~$ sudo apt install libpam-krb5 -y<\/code><\/pre>\n<p>\u0412 Debian \u043d\u043e\u0432\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e PAM \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u0441\u043f\u0435\u0440\u0432\u0430 \u043b\u043e\u0433\u0438\u043d\/\u043f\u0430\u0440\u043e\u043b\u044c \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c\u0441\u044f \u0432 Kerberos, \u0438, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u0443\u0434\u0430\u0447\u0438, \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0431\u0430\u0437\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439:<\/p>\n<pre><code>student@debian:~$ less \/etc\/pam.d\/common-auth<\/code><\/pre>\n<pre><code>... auth    [success=2 default=ignore]      pam_krb5.so minimum_uid=1000 auth    [success=1 default=ignore]      pam_unix.so nullok try_first_pas ...<\/code><\/pre>\n<p>\u043e\u0434\u043d\u0430\u043a\u043e, \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u0432\u043e\u0439\u0442\u0438 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0434\u043e\u043c\u0435\u043d\u043d\u044b\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u0441\u044f \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u043e:<\/p>\n<pre><code>student@debian:~$ sudo login debian login: ivanovii Password: Authentication failure<\/code><\/pre>\n<p>\u0430 \u0432 \u0436\u0443\u0440\u043d\u0430\u043b\u0435 \u0432\u0438\u0434\u043d\u0430 \u043f\u0440\u0438\u0447\u0438\u043d\u0430:<\/p>\n<pre><code>student@debian:~$ sudo tail \/var\/log\/auth.log ... Feb 22 01:18:43 debian login[1587]: pam_krb5(login:auth): user ivanovii authenticated as ivanovii@CORP.RU Feb 22 01:18:43 debian login[1587]: pam_unix(login:account): could not identify user (from getpwnam(ivanovii)) ...<\/code><\/pre>\n<p>\u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0448\u043b\u0430 \u0443\u0441\u043f\u0435\u0448\u043d\u043e, \u043d\u043e \u0434\u0430\u043b\u044c\u0448\u0435, \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0437\u043d\u0430\u0435\u0442 \u043e \u043d\u0430\u0448\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435 (\u043d\u0438 UID, \u043d\u0438 GID \u043d\u0438 \u043f\u0440\u043e\u0447\u0438\u0445 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432)<\/p>\n<pre><code>$ id ivanovii id: \u2018ivanovii\u2019: no such user<\/code><\/pre>\n<p>\u0412\u043e\u0442 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043f\u043e\u0434\u043e\u0448\u043b\u0438 \u043a \u044d\u0442\u0430\u043f\u0443, \u0440\u0430\u0434\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0438\u0441\u0430\u043b\u0430\u0441\u044c \u0441\u0442\u0430\u0442\u044c\u044f:)<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0430\u0447\u0430\u0442\u044c \u0438\u0441\u043a\u0430\u0442\u044c \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438, \u0442\u043e, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0412\u044b \u0443\u0437\u043d\u0430\u0435\u0442\u0435 \u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 Name Service Switch (NSS) \u0438 \u043c\u043e\u0434\u0443\u043b\u044f\u0445 LDAP, WinBIND \u0438\u043b\u0438 SSSD \u0434\u043b\u044f \u043d\u0435\u0435. \u041d\u043e \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u2026 \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0443\u0447\u0435\u0442\u043d\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c \u043f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438?<\/p>\n<p>\u041e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 PAM \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0442\u044c \u0441\u0432\u043e\u0438\u043c\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u043c\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043c\u043e\u0434\u0443\u043b\u044c pam_script. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0435\u0433\u043e \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443:<\/p>\n<pre><code>student@debian:~$ sudo apt install libpam-script -y<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u0430\u0432\u0442\u043e\u0440\u044b \u043f\u0430\u043a\u0435\u0442\u0430 \u0434\u043b\u044f Debian \u043d\u0435 \u0443\u0433\u0430\u0434\u0430\u043b\u0438 \u043d\u0430\u0448 \u0437\u0430\u043c\u044b\u0441\u0435\u043b, \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0438\u0432 \u043c\u043e\u0434\u0443\u043b\u0438 \u0432 \u0442\u0430\u043a\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435:<\/p>\n<pre><code>student@debian:~$ less \/etc\/pam.d\/common-auth ... auth    [success=3 default=ignore]      pam_krb5.so minimum_uid=1000 auth    sufficient                      pam_script.so auth    [success=1 default=ignore]      pam_unix.so nullok try_first_pass ...<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0447\u0435\u0441\u0442\u043d\u043e, \u0442\u043e \u0442\u0430\u043a\u0430\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0438, \u043d\u043e \u0438 \u043e\u0447\u0435\u043d\u044c \u043d\u0435 \u0445\u043e\u0440\u043e\u0448\u0430 \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438, \u043b\u0435\u0433\u043a\u043e \u0434\u043e\u0432\u0435\u0441\u0442\u0438 \u0435\u0435 \u0434\u043e \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u043a\u043e\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0437\u043d\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u043d \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 root, \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u043f\u0430\u0440\u043e\u043b\u044c \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442 \u043b\u044e\u0431\u043e\u0439 (\u0432\u043e\u0442 \u0437\u0430 \u044d\u0442\u043e \u043b\u044e\u0431\u0438\u043b FreeBSD, \u043e\u043d\u0430 \u0437\u0430 \u043d\u0430\u0441 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u0442:) \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u043f\u043e\u043f\u0440\u0430\u0432\u044c\u0442\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0438\u0432 \u043c\u043e\u0434\u0443\u043b\u0438 \u0442\u0430\u043a:<\/p>\n<pre><code>student@debian:~$ sudo nano \/etc\/pam.d\/common-auth<\/code><\/pre>\n<pre><code>auth    [success=2 default=ignore]      pam_krb5.so minimum_uid=1000 auth    [success=2 default=ignore]      pam_unix.so nullok_secure try_first_pass auth    requisite                       pam_deny.so auth    sufficient                      pam_script.so auth    required                        pam_permit.so<\/code><\/pre>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0443\u0447\u0442\u0451\u043d\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 Kerberos, \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u201c\u043f\u0435\u0440\u0435\u043f\u0440\u044b\u0433\u043d\u0435\u0442\u201d \u0434\u0432\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0448\u0430\u0433\u0430 \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442 \u043c\u043e\u0434\u0443\u043b\u044c pam_script. \u041e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0443\u0447\u0435\u0442\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438, \u0438, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 &#8212; \u0441\u043e\u0437\u0434\u0430\u0441\u0442:<\/p>\n<pre><code>student@debian:~$ sudo nano \/usr\/share\/libpam-script\/pam_script_auth<\/code><\/pre>\n<pre><code>#!\/bin\/bash  id \"$PAM_USER\" &amp;>\/dev\/null || useradd -m -s \/bin\/bash \"$PAM_USER\"<\/code><\/pre>\n<pre><code>student@debian:~$ sudo chmod +x \/usr\/share\/libpam-script\/pam_script_auth<\/code><\/pre>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c:<\/p>\n<pre><code>student@debian:~$ sudo login debian login: ivanovii Password: ... ivanovii@debian:~$ id uid=1001(ivanovii) gid=1001(ivanovii) groups=1001(ivanovii)  ivanovii@debian:~$ klist Ticket cache: FILE:\/tmp\/krb5cc_1001_0zzvqR Default principal: ivanovii@CORP.RU Valid starting       Expires              Service principal 02\/22\/2023 04:14:30  02\/22\/2023 14:14:30  krbtgt\/CORP.RU@CORP.RU renew until 02\/23\/2023 04:14:30<\/code><\/pre>\n<p>\u041d\u0443 \u0432\u043e\u0442 \u0438 \u0432\u0441\u0435, \u043c\u044b \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u0438 TGT \u0443 \u043d\u0430\u0441 \u0432 \u043a\u0430\u0440\u043c\u0430\u043d\u0435:)<\/p>\n<p>\u041e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u043c \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u043e\u043c \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u043e, \u0447\u0442\u043e \u043f\u043e\u0441\u043b\u0435 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0443\u0447\u0451\u0442\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438\u0437 \u0434\u043e\u043c\u0435\u043d\u0430, \u043e\u043d\u0430 \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u043d\u0430 \u0432\u0441\u0435\u0445 \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u0441\u0442\u0430\u043d\u0446\u0438\u044f\u0445, \u0437\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u043b. \u041d\u043e, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u044d\u0442\u0438\u043c\u0438 \u0443\u0447\u0442\u0451\u043d\u043d\u044b\u043c\u0438 \u0437\u0430\u043f\u0438\u0441\u044f\u043c\u0438 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e (\u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0431\u0430\u0437\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043e\u043d\u0438 \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u044b), \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043a\u0430 \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432\u0441\u0435 \u043a\u0430\u043a \u0435\u0441\u0442\u044c.<\/p>\n<p>\u0421\u043f\u0430\u0441\u0438\u0431\u043e, \u0447\u0442\u043e \u0434\u043e\u0447\u0438\u0442\u0430\u043b\u0438 \u0434\u043e \u043a\u043e\u043d\u0446\u0430, \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0431\u044b\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u0441\u0441\u044b\u043b\u043a\u0438, \u0431\u0443\u0434\u0443 \u0440\u0430\u0434 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c, \u0434\u043e \u043d\u043e\u0432\u044b\u0445 \u0432\u0441\u0442\u0440\u0435\u0447!<\/p>\n<p>\u0421\u0441\u044b\u043b\u043a\u0438:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/bestprogrammer.ru\/izuchenie\/kerberos-za-5-minut-znakomstvo-s-setevoj-autentifikatsiej\" rel=\"noopener noreferrer nofollow\">Kerberos \u0437\u0430 5 \u043c\u0438\u043d\u0443\u0442: \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0441 \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0435\u0439<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/youtu.be\/S7QOkcznEVY\" rel=\"noopener noreferrer nofollow\">\u0417\u0430\u0447\u0435\u043c \u0432\u0432\u043e\u0434\u0438\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u044b Linux \u0432 \u0434\u043e\u043c\u0435\u043d Microsoft?<\/a><\/p>\n<\/li>\n<\/ul>\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\/post\/718632\/\"> https:\/\/habr.com\/ru\/post\/718632\/<\/a><br \/><\/br><\/br><\/p>\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-345789","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/345789","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=345789"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/345789\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=345789"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=345789"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=345789"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}