{"id":271405,"date":"2015-12-30T13:35:02","date_gmt":"2015-12-30T10:35:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=271405"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=271405","title":{"rendered":"\u0410\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0432 CentOS \u0447\u0435\u0440\u0435\u0437 Microsoft Azure AD \/ Office 365"},"content":{"rendered":"<p>       \u0412\u0441\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 Microsoft Office 365 (\u0434\u043b\u044f \u0431\u0438\u0437\u043d\u0435\u0441\u0430) \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0442 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u0438\u043c\u0435\u043d\u043d\u043e \u0447\u0435\u0440\u0435\u0437 Microsoft Azure AD. \u0422\u0430\u043a, \u043f\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f (\u0435\u043c\u0435\u0439\u043b\u0430) \u0432 Office 365, \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u0432 Microsoft Azure AD.<\/p>\n<p>  <a href=\"http:\/\/habrahabr.ru\/post\/274249\/\">\u0420\u0430\u043d\u0435\u0435<\/a> \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u043b \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Microsoft Azure AD \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 Ununtu 14.04. \u0422\u043e \u0435\u0441\u0442\u044c, \u043a\u0430\u043a \u0432 Ubuntu \u0441\u0434\u0435\u043b\u0430\u0442\u044c SSO c Microsoft Azure AD \/ Office 365. \u0421\u0435\u0439\u0447\u0430\u0441 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0432 CentOS 7.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h2>1. \u041f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f<\/h2>\n<p>  <\/p>\n<ul>\n<li>\u0410\u043a\u043a\u0430\u0443\u043d\u0442 Microsoft Azure AD \/ Office 365 (business) <\/li>\n<li>CentOS \u0441\u0435\u0440\u0432\u0435\u0440 \u0441 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u043a \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442<\/li>\n<li>\u0412 CentOS \u0441\u0435\u0440\u0432\u0435\u0440 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d \u00abEnforcing\u00bb \u0440\u0435\u0436\u0438\u043c SElinux<\/li>\n<\/ul>\n<p>  <\/p>\n<h2>2. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Microsoft Azure AD<\/h2>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430, \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 Microsoft Azure AD \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u043b\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438. \u041a\u0430\u043a \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u2014 \u044f \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u043f\u0438\u0441\u0430\u043b \u0432 \u043f.2 <a href=\"http:\/\/habrahabr.ru\/post\/274249\/\">habrahabr.ru\/post\/274249<\/a><\/p>\n<h2>3. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 CentOS 7<\/h2>\n<p>  \u0417\u0430\u0445\u043e\u0434\u0438\u043c \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u043e SSH (\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c user123, \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434 sudo), \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043d\u0430 root \u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c epel-release  <\/p>\n<pre><code class=\"bash\">sudo su - yum install epel-release <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/085\/3f8\/272\/0853f8272bb84a14add9fe6de90e46a7.png\"\/><\/p>\n<p>  \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c git, npm, nodejs  <\/p>\n<pre><code class=\"bash\">yum install git npm nodejs <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/aa0\/7a2\/5fb\/aa07a25fb9d9495898c3cf8f415682dd.png\"\/><\/p>\n<p>  \u041a\u043b\u043e\u043d\u0438\u0440\u0443\u0435\u043c git-\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u0430\u0440\u0438\u0439 <a href=\"https:\/\/github.com\/bureado\/aad-login\">github.com\/bureado\/aad-login<\/a>  <\/p>\n<pre><code class=\"bash\">git clone https:\/\/github.com\/bureado\/aad-login <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/13b\/04b\/9aa\/13b04b9aaf124d2f888db0cd1107594f.png\"\/><\/p>\n<p>  \u0412\u0445\u043e\u0434\u0438\u043c \u0432 \u0441\u043a\u043b\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433, \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \/opt\/aad-login, \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c aad-login.js package.json \u0432 \/opt\/aad-login\/, \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c aad-login \u0432 \/usr\/local\/bin\/  <\/p>\n<pre><code class=\"bash\">cd aad-login\/ mkdir -p \/opt\/aad-login cp aad-login.js package.json \/opt\/aad-login\/ cp aad-login \/usr\/local\/bin\/ <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/a98\/6d7\/1ba\/a986d71ba2054eb0a289d83232f7a82d.png\"\/><\/p>\n<p>  \u0412\u0445\u043e\u0434\u0438\u043c \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \/opt\/aad-login\/, \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b npm  <\/p>\n<pre><code class=\"bash\">cd \/opt\/aad-login\/ npm install <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/a60\/e36\/5b9\/a60e365b985844fba107270f5b161f50.png\"\/><\/p>\n<p>  \u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c \u0444\u0430\u0439\u043b .\/aad-login.js<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/a40\/c9e\/6fb\/a40c9e6fbc004aa8a262605ee091a1b3.png\"\/><\/p>\n<p>  \u0417\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 directory \u0432\u0430\u0448\u0438\u043c \u0434\u043e\u043c\u0435\u043d\u043d\u044b\u043c \u0438\u043c\u0435\u043d\u0435\u043c, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 Microsoft Azure AD \/ Office 365, \u0430 clientid \u2014 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u00abClient ID\u00bb (\u00ab\u041a\u043e\u0434 \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u00bb), \u0440\u0430\u043d\u0435\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u043c \u043d\u0430 \u043f\u043e\u0440\u0442\u0430\u043b\u0435 Microsoft Azure AD<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/948\/3f3\/4bf\/9483f34bf5bc4bdc81321bd13c56b7da.png\"\/><\/p>\n<p>  \u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c \u0444\u0430\u0439\u043b \/etc\/pam.d\/sshd (\u0438\/\u0438\u043b\u0438 \/etc\/pam.d\/system-auth, \u0435\u0441\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e)<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/23b\/be3\/407\/23bbe340721241fea16f6d2afe2f3d97.png\"\/><\/p>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432\u044b\u0437\u043e\u0432 pam_exec, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0431\u044b\u043b \u043f\u0435\u0440\u0432\u044b\u043c \u0432 \u0441\u043f\u0438\u0441\u043a\u0435<br \/>  <code> auth sufficient pam_exec.so expose_authtok \/usr\/local\/bin\/aad-login <\/code><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/77e\/ba8\/0c2\/77eba80c2ab748ee9cf827563fb3e43e.png\"\/><\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d \u0432\u0445\u043e\u0434 (\u043f\u0430\u0440\u043e\u043b\u044c \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e). \u041b\u043e\u0433\u0438\u043d \u0442\u0430\u043a\u0438\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c \u0441 Alias \u0435\u043c\u0435\u0439\u043b\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f support, \u0435\u043c\u0435\u0439\u043b \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e support@aspanta.onmicrosoft.com.  <\/p>\n<pre><code class=\"bash\">useradd support <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/689\/60b\/425\/68960b4257e04503b420715063c20b6c.png\"\/><\/p>\n<p>  \u0412\u0441\u0435 \u0433\u043e\u0442\u043e\u0432\u043e!<br \/>  \u041f\u0440\u043e\u0431\u0443\u0435\u043c \u0432\u043e\u0439\u0442\u0438 \u043f\u043e\u0434 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u0438 \u043f\u0430\u0440\u043e\u043b\u0435\u043c, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c \u0432 Microsoft Azure AD \/ Office 365.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/051\/2d4\/d0e\/0512d4d0eeee401c959f51da1620ba69.png\"\/>               <\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/274255\/\"> http:\/\/habrahabr.ru\/post\/274255\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u0412\u0441\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 Microsoft Office 365 (\u0434\u043b\u044f \u0431\u0438\u0437\u043d\u0435\u0441\u0430) \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0442 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u0438\u043c\u0435\u043d\u043d\u043e \u0447\u0435\u0440\u0435\u0437 Microsoft Azure AD. \u0422\u0430\u043a, \u043f\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f (\u0435\u043c\u0435\u0439\u043b\u0430) \u0432 Office 365, \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u0432 Microsoft Azure AD.<\/p>\n<p>  <a href=\"http:\/\/habrahabr.ru\/post\/274249\/\">\u0420\u0430\u043d\u0435\u0435<\/a> \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u043b \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Microsoft Azure AD \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 Ununtu 14.04. \u0422\u043e \u0435\u0441\u0442\u044c, \u043a\u0430\u043a \u0432 Ubuntu \u0441\u0434\u0435\u043b\u0430\u0442\u044c SSO c Microsoft Azure AD \/ Office 365. \u0421\u0435\u0439\u0447\u0430\u0441 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0432 CentOS 7.  <\/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-271405","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/271405","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=271405"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/271405\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=271405"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=271405"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=271405"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}