{"id":326875,"date":"2022-01-10T08:40:26","date_gmt":"2022-01-10T08:40:26","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=326875"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=326875","title":{"rendered":"<span>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 CockroachDB \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Active Directory<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\" class=\"article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/su\/rq\/9f\/surq9ffkkxtrupqt8wqnseipe3k.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/su\/rq\/9f\/surq9ffkkxtrupqt8wqnseipe3k.jpeg\" data-blurred=\"true\"\/><\/div>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u043f\u043e\u0441\u0442\u0435 \u0440\u0430\u0441\u043a\u0440\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043e\u0441\u043d\u043e\u0432\u044b \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0421\u0423\u0411\u0414 CockroachDB \u0441 Active Directory. AD \u2014 \u043a\u043e\u043c\u043c\u0435\u0440\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u043e\u0431\u0440\u0430\u0442\u0438\u043c Kerberos, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0439 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0435\u0439 Microsoft.<\/p>\n<p>  \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043f\u0440\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e CockroachDB \u0441 Active Directory. \u0412 \u043e\u0441\u043d\u043e\u0432\u0435 \u0440\u0430\u0431\u043e\u0442\u044b Cockroach \u043b\u0435\u0436\u0438\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 <a href=\"https:\/\/www.cockroachlabs.com\/docs\/stable\/gssapi_authentication.html\">GSSAPI<\/a>. \u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f Cockroach \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u0410 \u0432\u043e\u0442 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f (OU) AD \u0441 \u0440\u043e\u043b\u044f\u043c\u0438 \u0432 Cockroach \u2014 \u0443\u0436\u0435 \u043d\u0435\u0442.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u041c\u043e\u044f \u0442\u0435\u0441\u0442\u043e\u0432\u0430\u044f \u0441\u0440\u0435\u0434\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 Active Directory \u043d\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435 Virtual Box \u043f\u043e\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c Windows Server 2016 \u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b Vagrant \u043f\u043e\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c CentOS 7, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0437\u0432\u0451\u0440\u043d\u0443\u0442\u0430 CockroachDB. \u0412\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0430\u0448\u0438\u043d\u044b \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u044b \u0432 \u0441\u0435\u0442\u044c \u0438 \u0432\u0438\u0434\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0445\u043e\u0441\u0442\u0443 \u0438 \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0443 (host-only). \u042d\u0442\u043e \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0430\u0436\u043d\u043e \u0434\u043b\u044f \u043c\u043e\u0435\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0434\u0430\u0451\u0442 \u0443\u0437\u043b\u0443 Cockroach \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441 AD \u0447\u0435\u0440\u0435\u0437 <a href=\"https:\/\/docs.oracle.com\/cd\/E26217_01\/E26214\/html\/firewalls.html\">\u043f\u043e\u0440\u0442 88<\/a>.<\/p>\n<h2><font color=\"#076184\">\u0422\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f:<\/font><\/h2>\n<p>  <\/p>\n<ol>\n<li>\u041a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0434\u043e\u043c\u0435\u043d\u0430 Active Directory.<\/li>\n<li>\u041e\u0421 Linux, \u0432 \u043c\u043e\u0451\u043c \u0441\u043b\u0443\u0447\u0430\u0435 RHEL7 \u0438 CockroachDB 20.1.1.<\/li>\n<\/ol>\n<p>  <\/p>\n<h2><font color=\"#076184\">\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f:<\/font><\/h2>\n<p>  <\/p>\n<ul>\n<li>\u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e Windows Server 2016. \u041f\u0440\u043e\u0431\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0441 \u043b\u044c\u0433\u043e\u0442\u043d\u044b\u043c \u043f\u0435\u0440\u0438\u043e\u0434\u043e\u043c 180 \u0434\u043d\u0435\u0439 \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c <a href=\"https:\/\/www.microsoft.com\/en-us\/evalcenter\/evaluate-windows-server\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/li>\n<li>\u0414\u043b\u044f \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u0439 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 Windows Server \u043d\u0430 \u0412\u041c Virtual Box \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b, \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0432\u043e\u0442 <a href=\"https:\/\/www.sysnettechsolutions.com\/en\/install-windows-server-2019-oracle-vm-virtualbox\/\">\u044d\u0442\u043e \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e<\/a>.<\/li>\n<li>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f VirtualBox Guest Additions \u043f\u043e <a href=\"https:\/\/www.sysnettechsolutions.com\/en\/install-guest-additions\/\">\u044d\u0442\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438<\/a>.<\/li>\n<li>\u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 AD \u0438 \u0445\u043e\u0441\u0442\u0443 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 <a href=\"https:\/\/www.howtogeek.com\/189974\/how-to-share-your-computers-files-with-a-virtual-machine\/\">\u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0439<\/a>. \u041e\u043d\u0430 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f, \u0447\u0442\u043e\u0431\u044b \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b \u043a\u043b\u044e\u0447\u0435\u0439 (keytab) \u043d\u0430 \u0443\u0437\u043b\u044b Cockroach.<\/li>\n<li>\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u0435 <a href=\"https:\/\/www.hostwinds.com\/guide\/change-windows-vps-hostname\/\">\u0438\u043c\u044f \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430 \u043c\u0430\u0448\u0438\u043d\u044b<\/a> \u0441 AD \u043d\u0430 \u0443\u0434\u043e\u0431\u043d\u043e\u0435 \u0434\u043b\u044f \u0432\u043e\u0441\u043f\u0440\u0438\u044f\u0442\u0438\u044f. \u0423 \u043c\u0435\u043d\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u044d\u0442\u043e adserver.<\/li>\n<li>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440 AD \u0438 \u0443\u0437\u043b\u044b Cockroach \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0434\u0430\u0442\u0435 \u0438 \u0447\u0430\u0441\u043e\u0432\u043e\u043c\u0443 \u043f\u043e\u044f\u0441\u0443. \u041f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 Kerberos \u044d\u0442\u043e \u0441\u0430\u043c\u043e \u0441\u043e\u0431\u043e\u0439 \u0440\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u043d\u043e \u043d\u0435\u043b\u0438\u0448\u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u044c \u0438 \u0437\u0434\u0435\u0441\u044c.<\/li>\n<li>\u0421\u043c\u0435\u043d\u0438\u0442\u0435 IP-\u0430\u0434\u0440\u0435\u0441 Windows \u043d\u0430 \u043f\u043e\u0434\u0441\u0435\u0442\u044c \u0443\u0437\u043b\u0430 (\u0438\u043b\u0438 \u0443\u0437\u043b\u043e\u0432) CockroachDB.<\/li>\n<li>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0443\u0437\u043b\u044b Cockroach \u0432 <a href=\"https:\/\/support.rackspace.com\/how-to\/modify-your-hosts-file\">\u0444\u0430\u0439\u043b hosts<\/a> \u0432 Windows (\u044d\u0442\u043e \u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0448\u0430\u0433).<\/li>\n<li>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0434\u043e\u043c\u0435\u043d\u0430 Active Directory \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"http:\/\/pc-addicts.com\/setup-active-directory-server-2016\/\">\u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430<\/a>.<\/li>\n<\/ul>\n<p>  \u0420\u0438\u0441\u0443\u043d\u043a\u0438 \u043d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u0434\u043b\u044f \u0441\u043f\u0440\u0430\u0432\u043a\u0438 \u2014 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044f \u0448\u0430\u0433\u0438 \u0432 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430\u0445, \u0432\u044b \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e \u0443\u0436\u0435 \u0434\u043e\u0441\u0442\u0438\u0433\u043b\u0438 \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430.<\/p>\n<h3><font color=\"#163C51\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Windows Server<\/font><\/h3>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/hw\/pn\/fy\/hwpnfyhjo8phn4tjloohnfowqae.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/hw\/pn\/fy\/hwpnfyhjo8phn4tjloohnfowqae.jpeg\" data-blurred=\"true\"\/><\/div>\n<p>  <\/p>\n<h3><font color=\"#163C51\">\u0421\u043c\u0435\u043d\u0430 \u0438\u043c\u0435\u043d\u0438 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430 Windows<\/font><\/h3>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/oc\/v_\/ke\/ocv_kec-0gmxhjwk_u_roasiq54.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/oc\/v_\/ke\/ocv_kec-0gmxhjwk_u_roasiq54.jpeg\" data-blurred=\"true\"\/><\/div>\n<p>  <\/p>\n<h3><font color=\"#163C51\">\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u0438\u043c\u0435\u043d\u0438 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430<\/font><\/h3>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/mn\/ms\/fp\/mnmsfpfrg8awzxn4evdceo8wzqq.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/mn\/ms\/fp\/mnmsfpfrg8awzxn4evdceo8wzqq.jpeg\" data-blurred=\"true\"\/><\/div>\n<p>  <\/p>\n<h3><font color=\"#163C51\">\u0421\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0434\u0430\u0442\u0435, \u0447\u0430\u0441\u043e\u0432\u043e\u043c\u0443 \u043f\u043e\u044f\u0441\u0443<\/font><\/h3>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/0k\/t2\/5p\/0kt25pmdoi96eeby8uyvj6kwqba.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/0k\/t2\/5p\/0kt25pmdoi96eeby8uyvj6kwqba.jpeg\" data-blurred=\"true\"\/><\/div>\n<p>  <\/p>\n<h3><font color=\"#163C51\">\u0421\u043c\u0435\u043d\u0430 \u043f\u043e\u0434\u0441\u0435\u0442\u0438 AD \u043d\u0430 \u0442\u0443 \u0436\u0435, \u0447\u0442\u043e \u0438 \u0443 CockroachDB<\/font><\/h3>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/q5\/zf\/yw\/q5zfywmgwqza4tzoqow9xvbt5aq.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/q5\/zf\/yw\/q5zfywmgwqza4tzoqow9xvbt5aq.jpeg\" data-blurred=\"true\"\/><\/div>\n<p>  <\/p>\n<h3><font color=\"#163C51\">\u041e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e: \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0445\u043e\u0441\u0442\u043e\u0432 CockroachDB \u043a \u0444\u0430\u0439\u043b\u0443 hosts \u0441\u0435\u0440\u0432\u0435\u0440\u0430 AD<\/font><\/h3>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/6o\/-g\/sc\/6o-gscxbnxafupkztrboorogttk.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/6o\/-g\/sc\/6o-gscxbnxafupkztrboorogttk.jpeg\" data-blurred=\"true\"\/><\/div>\n<p>  \u041d\u0430 \u0434\u0430\u043d\u043d\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0443\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0441\u0432\u044f\u0437\u044c \u0441 CentOS \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 ping:<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/6d\/25\/mj\/6d25mjjqxxccb7lwnc3xgjbgmve.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/6d\/25\/mj\/6d25mjjqxxccb7lwnc3xgjbgmve.jpeg\" data-blurred=\"true\"\/><\/div>\n<p>  \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u0441 \u043c\u0430\u0448\u0438\u043d\u044b CentOS \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430 \/etc\/hosts.<\/p>\n<pre><code class=\"xml\">127.0.0.1   node.example.com    node 127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1     localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.33.15   adserver.example.comadserver<\/code><\/pre>\n<pre><code class=\"xml\">[vagrant@node ~]$ ping adserver.example.com PING adserver.example.com (192.168.33.15) 56(84) bytes of data. 64 bytes from adserver.example.com (192.168.33.15): icmp_seq=1 ttl=128 time=0.369 ms 64 bytes from adserver.example.com (192.168.33.15): icmp_seq=2 ttl=128 time=0.511 ms 64 bytes from adserver.example.com (192.168.33.15): icmp_seq=3 ttl=128 time=0.430 ms<\/code><\/pre>\n<p>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0435\u0440\u0435\u0441\u0442\u0440\u0430\u0445\u043e\u0432\u043a\u0438 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0443\u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443 AD \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043f\u043e\u0440\u0442 88. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 telnet:<\/p>\n<pre><code class=\"xml\">sudo yum install -y telnet<\/code><\/pre>\n<pre><code class=\"xml\">telnet adserver.example.com 88<\/code><\/pre>\n<pre><code class=\"xml\">Trying 192.168.33.15... Connected to adserver.example.com. Escape character is '^]'.<\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u043a \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044e \u0441\u0443\u0431\u044a\u0435\u043a\u0442\u0430-\u0441\u043b\u0443\u0436\u0431\u044b \u0432 AD. \u0421\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0439\u0442\u0435 \u0444\u0430\u0439\u043b \u043a\u043b\u044e\u0447\u0435\u0439 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0444\u0430\u0439\u043b\u0430 krb5.conf \u043d\u0430 \u043c\u0430\u0448\u0438\u043d\u0435 CentOS.<\/p>\n<p>  \u041d\u0430 \u043c\u0430\u0448\u0438\u043d\u0435 \u0441 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u043c AD \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u043a \u043a\u043e\u043d\u0441\u043e\u043b\u0438 Active Directory Users and Computers.<\/p>\n<p>  \u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u0440\u0430\u0432\u044b\u043c \u043d\u0430\u0436\u0430\u0442\u0438\u0435\u043c \u043d\u0430 Users \u043f\u043e\u0434 \u0434\u043e\u043c\u0435\u043d\u043e\u043c \u2014 \u0432 \u043c\u043e\u0451\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/n3\/pj\/z_\/n3pjz_tiai-bphcgu4byv4ntxku.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/n3\/pj\/z_\/n3pjz_tiai-bphcgu4byv4ntxku.jpeg\" data-blurred=\"true\"\/><\/div>\n<p>  \u0418 \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043d\u0443\u0436\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u0430\u0440\u043e\u043b\u044f \u0438 \u043d\u0430\u0436\u043c\u0438\u0442\u0435 Finish:<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/nt\/uu\/sz\/ntuuszcymvsxex4xtuo_csxzswa.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/nt\/uu\/sz\/ntuuszcymvsxex4xtuo_csxzswa.jpeg\" data-blurred=\"true\"\/><\/div>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/si\/ux\/17\/siux17v3mvwilx8g9t3ruatmcwc.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/si\/ux\/17\/siux17v3mvwilx8g9t3ruatmcwc.jpeg\" data-blurred=\"true\"\/><\/div>\n<p>  \u0412\u0430\u0436\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0434\u0432\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043e\u0442\u043d\u043e\u0441\u044f\u0449\u0438\u0435\u0441\u044f \u043a Kerberos. \u0412 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 Windows Server \u043c\u043d\u0435 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043d\u0435\u043b\u0435\u0433\u043a\u043e \u0438\u0445 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c. \u041e\u043d\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0432\u043a\u043b\u0430\u0434\u043a\u0430 Account. \u0427\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u0438\u0445 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435, \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u0438\u0442\u044c \u0432\u0441\u044e \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u0441 \u0444\u043b\u0430\u0436\u043a\u0430\u043c\u0438 \u0434\u043e \u043a\u043e\u043d\u0446\u0430.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/k3\/f3\/sz\/k3f3sztaxxh2diknlihfin1jbvy.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/k3\/f3\/sz\/k3f3sztaxxh2diknlihfin1jbvy.jpeg\" data-blurred=\"true\"\/><\/div>\n<p>  \u0414\u043b\u044f \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0448\u0430\u0433\u0430 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043a\u043d\u043e\u043f\u043a\u043e\u0439 Apply.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0438\u043c\u044f \u0441\u0443\u0431\u044a\u0435\u043a\u0442\u0430-\u0441\u043b\u0443\u0436\u0431\u044b (SPN, Service Principal Name) \u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u043a\u043b\u044e\u0447\u0435\u0439. \u0414\u043b\u044f \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u043f\u043e\u0434\u043e\u0439\u0434\u0451\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0438\u043b\u0438 PowerShell. \u0417\u0434\u0435\u0441\u044c \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043a\u0441\u0442\u0430\u0442\u0438 \u0443\u0442\u0438\u043b\u0438\u0442\u0430 AD \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <code>ktpass<\/code>:<\/p>\n<pre><code class=\"xml\">ktpass -out node.keytab -princ postgres\/node.example.com@EXAMPLE.COM -mapUser pguser@EXAMPLE.COM -mapOp set -pType KRB5_NT_PRINCIPAL -crypto AES256-SHA1 -pass CRDB123?<\/code><\/pre>\n<p>  \u042d\u0442\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0444\u0430\u0439\u043b \u043a\u043b\u044e\u0447\u0435\u0439 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c <code>node.keytab<\/code>, \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044f \u0438\u043c\u044f \u0441\u0443\u0431\u044a\u0435\u043a\u0442\u0430-\u0441\u043b\u0443\u0436\u0431\u044b <code>postgres<\/code> \u0441 FQDN \u0443\u0437\u043b\u0430 Cockroach <code>node.example.com@EXAMPLE.COM<\/code>, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f AD <code>pguser<\/code> \u0441 \u0438\u043c\u0435\u043d\u0435\u043c \u0441\u0443\u0431\u044a\u0435\u043a\u0442\u0430-\u0441\u043b\u0443\u0436\u0431\u044b. \u0423\u043a\u0430\u0436\u0435\u043c \u0440\u0435\u0436\u0438\u043c \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f <code>AES256-SHA1<\/code>, \u0438 \u043d\u0430\u043a\u043e\u043d\u0435\u0446 \u043f\u0435\u0440\u0435\u0434\u0430\u0434\u0438\u043c \u043f\u0430\u0440\u043e\u043b\u044c \u043a \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u043c\u0443 SPN.<\/p>\n<h3><font color=\"#163C51\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 \u043a\u043b\u044e\u0447\u0435\u0439 \u0438 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 SPN \u0441 \u0441\u0443\u0431\u044a\u0435\u043a\u0442\u043e\u043c<\/font><\/h3>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/su\/vj\/ko\/suvjkoorslxsijnu0wbdo6q5ydw.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/su\/vj\/ko\/suvjkoorslxsijnu0wbdo6q5ydw.jpeg\" data-blurred=\"true\"\/><\/div>\n<p>  \u041c\u043e\u0436\u0435\u043c \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c SPN \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<pre><code class=\"xml\">setspn -l pguser<\/code><\/pre>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/yp\/yz\/zv\/ypyzzvq108nogvhoorcccpnjkom.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/yp\/yz\/zv\/ypyzzvq108nogvhoorcccpnjkom.jpeg\" data-blurred=\"true\"\/><\/div>\n<p>  \u041d\u0430 \u0434\u0430\u043d\u043d\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0444\u0430\u0439\u043b \u043a\u043b\u044e\u0447\u0435\u0439, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u043a AD \u0441 \u043c\u0430\u0448\u0438\u043d\u044b CentOS. \u0421\u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0435\u0433\u043e \u0432 \u0444\u0430\u0439\u043b hosts \u0432 Cockroach.<\/p>\n<p>  \u041f\u0435\u0440\u0435\u0434 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0435\u0439 \u0441 AD \u0432 \u0444\u0430\u0439\u043b\u0435 hosts \u0432 CentOS \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0440\u044f\u0434 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0443\u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0434\u0430\u0442\u044b \u0438 \u0447\u0430\u0441\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u044f\u0441\u0430 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b:<\/p>\n<pre><code class=\"xml\">timedatectl timedatectl list-timezones | grep New_York<\/code><\/pre>\n<pre><code class=\"xml\">[vagrant@node ~]$ timedatectl   Local time: Wed 2020-06-03 17:00:01 UTC   Universal time: Wed 2020-06-03 17:00:01 UTC     RTC time: Wed 2020-06-03 16:59:59    Time zone: UTC (UTC, +0000)  NTP enabled: yes NTP synchronized: yes  RTC in local TZ: no   DST active: n\/a [vagrant@node ~]$ timedatectl list-timezones | grep New_York America\/New_York [vagrant@node ~]$ sudo timedatectl set-timezone America\/New_York [vagrant@node ~]$ timedatectl   Local time: Wed 2020-06-03 13:01:06 EDT   Universal time: Wed 2020-06-03 17:01:06 UTC     RTC time: Wed 2020-06-03 17:01:05    Time zone: America\/New_York (EDT, -0400)  NTP enabled: yes NTP synchronized: yes  RTC in local TZ: no   DST active: yes  Last DST change: DST began at               Sun 2020-03-08 01:59:59 EST               Sun 2020-03-08 03:00:00 EDT  Next DST change: DST ends (the clock jumps one hour backwards) at               Sun 2020-11-01 01:59:59 EDT               Sun 2020-11-01 01:00:00 EST<\/code><\/pre>\n<p>  \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u043f\u0430\u043a\u0435\u0442 <code>krb5-workstation<\/code> \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0435\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438, \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0434\u043b\u044f AD:<\/p>\n<pre><code class=\"xml\">yum install -y krb5-workstation<\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0434\u0438\u0442\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0444\u0430\u0439\u043b\u0430 <code>\/etc\/krb5.conf<\/code>, \u0443\u043a\u0430\u0437\u0430\u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430:<\/p>\n<pre><code class=\"xml\">[logging]  default = FILE:\/var\/log\/krb5libs.log  kdc = FILE:\/var\/log\/krb5kdc.log  admin_server = FILE:\/var\/log\/kadmind.log   [libdefaults]  default_realm = EXAMPLE.COM   [realms]  EXAMPLE.COM = {   kdc = adserver.example.com   admin_server = adserver.example.com   default_domain = example.com  }   [domain_realm]  .example.com = EXAMPLE.COM  example.com = EXAMPLE.COM<\/code><\/pre>\n<p>  \u0418\u0437\u043c\u0435\u043d\u0438\u0442\u0435 \u043f\u0440\u0430\u0432\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0432 \u0444\u0430\u0439\u043b\u0435 \u043a\u043b\u044e\u0447\u0435\u0439:<\/p>\n<pre><code class=\"xml\">chmod 600 node.keytab<\/code><\/pre>\n<p>  \u0417\u0430\u0434\u0430\u0439\u0442\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <code>KRB5_KTNAME<\/code> \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044e \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430:<\/p>\n<pre><code class=\"xml\">export KRB5_KTNAME=node.keytab<\/code><\/pre>\n<p>  \u041f\u043e \u0438\u0434\u0435\u0435, \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0439\u0442\u0438 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0432 AD \u043f\u043e\u0434 \u0438\u043c\u0435\u043d\u0435\u043c <code>pguser<\/code>:<\/p>\n<pre><code class=\"xml\">[vagrant@node ~]$ kinit pguser Password for pguser@EXAMPLE.COM: [vagrant@node ~]$ klist Ticket cache: FILE:\/tmp\/krb5cc_1000 Default principal: pguser@EXAMPLE.COM   Valid starting   Expires          Service principal 06\/03\/2020 13:23:06  06\/03\/2020 23:23:06  krbtgt\/EXAMPLE.COM@EXAMPLE.COM     renew until 06\/04\/2020 13:23:06<\/code><\/pre>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0435\u0449\u0451 \u043f\u0430\u0440\u0443 \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u0444\u0430\u0439\u043b\u0435 \u043a\u043b\u044e\u0447\u0435\u0439, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0434\u043e\u043b\u0433\u0438\u0445 \u0447\u0430\u0441\u043e\u0432 \u043c\u0443\u0447\u0435\u043d\u0438\u0439 \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c. \u041f\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u043c\u043e\u0435\u043c\u0443 \u0433\u043e\u0440\u044c\u043a\u043e\u043c\u0443 \u043e\u043f\u044b\u0442\u0443!<\/p>\n<p>  \u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c Kerberos \u043d\u043e\u043c\u0435\u0440 <code>KVNO<\/code> \u0434\u043b\u044f \u0441\u0443\u0431\u044a\u0435\u043a\u0442\u0430 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043f\u043e\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u041e\u0421 \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u0430 Unix \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u0438\u043b\u0438 \u0440\u0430\u0432\u043d\u044f\u0442\u044c\u0441\u044f 3. \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"xml\">kvno pguser@EXAMPLE.COM<\/code><\/pre>\n<pre><code class=\"xml\">pguser@EXAMPLE.COM: kvno = 3<\/code><\/pre>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0443\u0431\u0435\u0434\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u043d\u043e\u043c\u0435\u0440 KVNO \u043d\u0430\u0448\u0435\u0433\u043e \u0438\u043c\u0435\u043d\u0438 SPN \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u0443\u0431\u044a\u0435\u043a\u0442\u0443:<\/p>\n<pre><code class=\"xml\">kvno postgres\/node.example.com@EXAMPLE.COM<\/code><\/pre>\n<pre><code class=\"xml\">[vagrant@node ~]$ kvno postgres\/node.example.com@EXAMPLE.COM postgres\/node.example.com@EXAMPLE.COM: kvno = 3<\/code><\/pre>\n<p>  \u041c\u043e\u0436\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 \u043a\u043b\u044e\u0447\u0435\u0439:<\/p>\n<pre><code class=\"xml\">[vagrant@node ~]$ klist -kt node.keytab Keytab name: FILE:node.keytab KVNO Timestamp       Principal ---- ------------------- ------------------------------------------------------    3 12\/31\/1969 19:00:00 postgres\/node.example.com@EXAMPLE.COM<\/code><\/pre>\n<p>  \u0422\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>ktutil<\/code>:<\/p>\n<pre><code class=\"xml\">[vagrant@node ~]$ ktutil ktutil:  read_kt node.keytab ktutil:  list slot KVNO Principal ---- ---- ---------------------------------------------------------------------    13postgres\/node.example.com@EXAMPLE.COM<\/code><\/pre>\n<p>  \u0425\u043e\u0442\u044f \u043c\u044b \u0443\u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b\u0438 \u043e\u0431\u0430 \u043d\u043e\u043c\u0435\u0440\u0430 KVNO, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0441\u0442\u0440\u0430\u0445\u043e\u0432\u043a\u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u043c \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 AD.<br \/>  \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 KVNO, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0432 PowerShell \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<pre><code class=\"xml\">Get-ADUser pguser -property msDS-KeyVersionNumber<\/code><\/pre>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/js\/lv\/fz\/jslvfz6yxst3betpg9d6psjeur4.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/js\/lv\/fz\/jslvfz6yxst3betpg9d6psjeur4.jpeg\" data-blurred=\"true\"\/><\/div>\n<p>  \u0420\u0430\u0437 \u0432\u0441\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442, \u043c\u043e\u0436\u0435\u043c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 GSSAPI \u0432 Cockroach.<\/p>\n<p>  \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 <a href=\"https:\/\/www.cockroachlabs.com\/docs\/stable\/install-cockroachdb-linux.html\">CockroachDB<\/a>:<\/p>\n<pre><code class=\"xml\">COCKROACH_VERSION=v21.2.0 wget -qO- https:\/\/binaries.cockroachdb.com\/cockroach-$COCKROACH_VERSION.linux-amd64.tgz | tar  xvz sudo cp -i cockroach-$COCKROACH_VERSION.linux-amd64\/cockroach \/usr\/local\/bin\/ cockroach version<\/code><\/pre>\n<pre><code class=\"xml\">Build Tag:v21.2.0 Build Time:   2021\/11\/15 14:00:58 Distribution: CCL Platform: linux amd64 (x86_64-unknown-linux-gnu) Go Version:   go1.16.6 C Compiler:   Clang 10.0.0 Build SHA-1:  6123c0c73ff0eea223cfd25e1e557648413126f8 Build Type:   release<\/code><\/pre>\n<p>  \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0437\u0430\u0449\u0438\u0449\u0451\u043d\u043d\u044b\u0439 <a href=\"https:\/\/www.cockroachlabs.com\/docs\/stable\/secure-a-cluster.html\">\u043a\u043b\u0430\u0441\u0442\u0435\u0440<\/a>.<\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u044b. \u041f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u0430\u044f \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438, \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u0446\u0435\u043b\u0435\u0439 \u043f\u043e\u0434\u043e\u0439\u0434\u0451\u0442. \u042f \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0435 certs \u0434\u043e\u0431\u0430\u0432\u043e\u0447\u043d\u044b\u0435 \u0438\u043c\u0435\u043d\u0430 DNS:<\/p>\n<pre><code class=\"xml\">HOSTNAME=\"node.example.com node 192.168.33.10\" mkdir certs my-safe-directory cockroach cert create-ca --certs-dir=certs --ca-key=my-safe-directory\/ca.key cockroach cert create-node $HOSTNAME --certs-dir=certs --ca-key=my-safe-directory\/ca.key openssl x509 -in certs\/node.crt -text | grep \"Subject Alternative Name\" -A 1 cockroach cert create-client root --certs-dir=certs --ca-key=my-safe-directory\/ca.key<\/code><\/pre>\n<pre><code class=\"xml\">[vagrant@node ~]$ openssl x509 -in certs\/node.crt -text | grep \"Subject Alternative Name\" -A 1         X509v3 Subject Alternative Name:             DNS:node.example.com, DNS:node, IP Address:192.168.33.10<\/code><\/pre>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c Cockroach \u0432 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435:<\/p>\n<pre><code class=\"xml\">cockroach start --certs-dir=certs --store=node1 --listen-addr=node.example.com:26257 --http-addr=node.example.com:8080 --join=node.example.com:26257,node.example.com:26258,node.example.com:26259 --background cockroach start --certs-dir=certs --store=node2 --listen-addr=node.example.com:26258 --http-addr=node.example.com:8081 --join=node.example.com:26257,node.example.com:26258,node.example.com:26259 --background cockroach start --certs-dir=certs --store=node3 --listen-addr=node.example.com:26259 --http-addr=node.example.com:8082 --join=node.example.com:26257,node.example.com:26258,node.example.com:26259 --background<\/code><\/pre>\n<p>  \u0418\u043d\u0438\u0446\u0438\u0438\u0440\u0443\u0435\u043c \u043a\u043b\u0430\u0441\u0442\u0435\u0440:<\/p>\n<pre><code class=\"xml\">[vagrant@node ~]$ cockroach init --certs-dir=certs --host=node.example.com:26257 Cluster successfully initialized<\/code><\/pre>\n<p>  \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<pre><code class=\"xml\">cockroach sql --certs-dir=certs --host=node.example.com<\/code><\/pre>\n<p>  \u0410\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0435\u043c \u043a\u043e\u0440\u043f\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u044e. GSSAPI \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043a\u043e\u0440\u043f\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438:<\/p>\n<pre><code class=\"xml\">SET CLUSTER SETTING cluster.organization = 'Acme Company'; SET CLUSTER SETTING enterprise.license = 'xxxxxxxxxxxx';<\/code><\/pre>\n<p>  \u0412\u043a\u043b\u044e\u0447\u0430\u0435\u043c GSSAPI \u2014 \u0434\u043b\u044f \u0432\u0441\u0435\u0445, \u043a\u0440\u043e\u043c\u0435 \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f (root user). \u041e\u043d \u0431\u0443\u0434\u0435\u0442 \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0433\u043e \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430:<\/p>\n<pre><code class=\"xml\">SET cluster setting server.host_based_authentication.configuration = 'host all all all gss include_realm=0';<\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u0440\u044f\u0434\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u043d\u0430\u0434\u0435\u043b\u044f\u0435\u043c \u0435\u0433\u043e \u043f\u0440\u0430\u0432\u0430\u043c\u0438:<\/p>\n<pre><code class=\"xml\">CREATE USER pguser; GRANT ALL ON DATABASE defaultdb TO pguser; \\q<\/code><\/pre>\n<p>  \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>kinit<\/code> \u043e\u0442 \u0438\u043c\u0435\u043d\u0438 <code>pguser<\/code>. \u0415\u0441\u043b\u0438 \u043f\u043e\u043c\u043d\u0438\u0442\u0435, \u043c\u044b \u0443\u0436\u0435 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u043b\u0438, \u043d\u043e \u0434\u043b\u044f \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0448\u0430\u0433 \u043d\u0430\u0434\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c:<\/p>\n<pre><code class=\"xml\">kdestroy -A kinit pguser klist<\/code><\/pre>\n<p>  \u0418 \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u043d\u0430\u0434\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442 <code>psql<\/code>, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 <code>cockroach.CLI<\/code> \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 GSSAPI.<\/p>\n<p>  \u041d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c psql-\u043a\u043b\u0438\u0435\u043d\u0442 \u0432\u0435\u0440\u0441\u0438\u0438 9.5, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 CockroachDB \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0432\u043e\u0434\u043d\u043e\u0439 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, CentOS 7 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 9.2, \u0438 \u0447\u0442\u043e\u0431\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u0443\u044e \u043d\u0430\u043c \u0432\u0435\u0440\u0441\u0438\u044e, \u043c\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0448\u0430\u0433\u0438, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 <a href=\"https:\/\/wiki.postgresql.org\/wiki\/YUM_Installation\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<p>  \u041e\u0442\u043a\u043b\u044e\u0447\u0438\u043c postgresql \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0430\u0445 [base] \u0438 [updates] \u0444\u0430\u0439\u043b\u0430 \/etc\/yum.repos.d\/CentOS-Base.repo \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 exclude=postgresql*:<\/p>\n<pre><code class=\"xml\">[base] name=CentOS-$releasever - Base mirrorlist=http:\/\/mirrorlist.centos.org\/?release=$releasever&amp;arch=$basearch&amp;repo=os&amp;infra=$infra #baseurl=http:\/\/mirror.centos.org\/centos\/$releasever\/os\/$basearch\/ gpgcheck=1 gpgkey=file:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-CentOS-7 exclude=postgresql*   #released updates [updates] name=CentOS-$releasever - Updates mirrorlist=http:\/\/mirrorlist.centos.org\/?release=$releasever&amp;arch=$basearch&amp;repo=updates&amp;infra=$infra #baseurl=http:\/\/mirror.centos.org\/centos\/$releasever\/updates\/$basearch\/ gpgcheck=1 gpgkey=file:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-CentOS-7 exclude=postgresql*<\/code><\/pre>\n<p>  \u0417\u0430\u0442\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e, \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u0443\u044e \u043f\u043e <a href=\"https:\/\/www.postgresql.org\/download\/linux\/redhat\/\">\u0441\u0441\u044b\u043b\u043a\u0435<\/a>. \u042f \u0432\u044b\u0431\u0438\u0440\u0430\u044e \u0432\u0435\u0440\u0441\u0438\u044e 9.5.<\/p>\n<pre><code class=\"xml\">yum install https:\/\/download.postgresql.org\/pub\/repos\/yum\/reporpms\/EL-7-x86_64\/pgdg-redhat-repo-latest.noarch.rpm -y yum install postgresql95 -y<\/code><\/pre>\n<p>  \u0418 \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u043a CockroachDB \u043a\u0430\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c pguser:<\/p>\n<pre><code class=\"xml\">psql \"postgresql:\/\/node.example.com:26257\/defaultdb?sslmode=require\" -U pguser<\/code><\/pre>\n<pre><code class=\"xml\">psql (9.5.22, server 9.5.0) SSL connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES128-GCM-SHA256, bits: 128, compression: off) Type \"help\" for help.   defaultdb=><\/code><\/pre>\n<p>  \u0410 \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043c\u043d\u043e\u0433\u043e \u0443\u0437\u043b\u043e\u0432, \u043a\u0430\u043a \u044d\u0442\u043e \u0447\u0430\u0441\u0442\u043e \u0431\u044b\u0432\u0430\u0435\u0442 \u0432 CockroachDB? \u041d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u0441\u0435 \u0443\u0437\u043b\u044b \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u043e\u0432 \u0432 \u0444\u0430\u0439\u043b\u0435 \u043a\u043b\u044e\u0447\u0435\u0439. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0443 \u043c\u0435\u043d\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0443\u0437\u0435\u043b \u2014 <code>node.example.com<\/code> \u2014 \u044f \u0443\u043a\u0430\u0436\u0443 \u0435\u0433\u043e \u0438 \u0447\u0435\u0440\u0435\u0437 IP-\u0430\u0434\u0440\u0435\u0441, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0448\u0430\u0433:<\/p>\n<p>  \u041c\u043e\u0439 IP-\u0430\u0434\u0440\u0435\u0441 \u2014 192.168.33.10. \u041a\u043e\u043c\u0430\u043d\u0434\u0430 <code>ktpass<\/code> \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0443\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u043d\u043e\u0439 \u0432\u0438\u0434:<\/p>\n<pre><code class=\"xml\">ktpass -out ip.keytab -princ postgres\/192.168.33.10@EXAMPLE.COM -mapUser pguser@EXAMPLE.COM -mapOp add -pType KRB5_NT_PRINCIPAL -crypto AES256-SHA1 -pass CRDB123?<\/code><\/pre>\n<p>  \u0417\u0430\u043c\u0435\u0442\u044c\u0442\u0435, \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b \u043a\u043b\u044e\u0447\u0435\u0439 \u2014 \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0443\u0436\u0435 \u0438\u043c\u0435\u044e\u0449\u0438\u0439\u0441\u044f. \u041c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043a\u0430\u043a \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c\u0443 \u0438\u043b\u0438 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0438\u0445 \u043f\u043e\u0437\u0434\u043d\u0435\u0435. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u044f \u0438\u0437\u043c\u0435\u043d\u0438\u043b <code>-mapOp<\/code> \u043d\u0430 <code>add<\/code> \u0441 <code>set<\/code>. \u042d\u0442\u043e \u0432\u0430\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0437\u0430\u043c\u0435\u043d\u044b \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u043d\u0430 \u043d\u043e\u0432\u0443\u044e. \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435:<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/9c\/zx\/_t\/9czx_tee4me97bidi_at-fb7eim.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/9c\/zx\/_t\/9czx_tee4me97bidi_at-fb7eim.jpeg\" data-blurred=\"true\"\/><\/div>\n<p>  \u041f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>setspn -l user<\/code> \u0431\u0443\u0434\u0443\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u043e\u0431\u0435 \u0437\u0430\u043f\u0438\u0441\u0438:<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/wf\/j_\/ln\/wfj_ln0qkjnn16d5usxbpdt8hcy.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/wf\/j_\/ln\/wfj_ln0qkjnn16d5usxbpdt8hcy.jpeg\" data-blurred=\"true\"\/><\/div>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u043d\u043e\u043c\u0435\u0440 KVNO, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u044b \u0432\u043d\u043e\u0441\u0438\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0441\u0443\u0431\u044a\u0435\u043a\u0442\u0430:<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/nc\/vi\/p6\/ncvip6ebhurr2w_2i0-mswaqkua.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/nc\/vi\/p6\/ncvip6ebhurr2w_2i0-mswaqkua.jpeg\" data-blurred=\"true\"\/><\/div>\n<p>  \u0417\u0430\u043c\u0435\u0442\u044c\u0442\u0435, \u043d\u043e\u043c\u0435\u0440 KVNO \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u043b\u0441\u044f.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0444\u0430\u0439\u043b \u043a\u043b\u044e\u0447\u0435\u0439 \u0432 host CockroachDB \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0432\u0441\u0451 \u043b\u0438 \u0442\u0430\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e:<\/p>\n<pre><code class=\"xml\">[vagrant@node ~]$ klist -kt ip.keytab Keytab name: FILE:ip.keytab KVNO Timestamp       Principal ---- ------------------- ------------------------------------------------------    4 12\/31\/1969 19:00:00 postgres\/192.168.33.10@EXAMPLE.COM<\/code><\/pre>\n<p>  \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u044f KVNO \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442:<\/p>\n<pre><code class=\"xml\">[vagrant@node ~]$ kvno pguser@EXAMPLE.COM pguser@EXAMPLE.COM: kvno = 4 [vagrant@node ~]$ kvno postgres\/192.168.33.10@EXAMPLE.COM postgres\/192.168.33.10@EXAMPLE.COM: kvno = 4 [vagrant@node ~]$ kvno postgres\/node.example.com@EXAMPLE.COM postgres\/node.example.com@EXAMPLE.COM: kvno = 3<\/code><\/pre>\n<p>  \u041d\u043e\u043c\u0435\u0440 KVNO \u0434\u043b\u044f \u0443\u0437\u043b\u0430 node.example.com \u0432\u0441\u0451 \u0435\u0449\u0451 \u0440\u0430\u0432\u0435\u043d 3, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u0441\u0442\u0430\u0440\u044b\u0439 \u0444\u0430\u0439\u043b \u043a\u043b\u044e\u0447\u0435\u0439 \u2014 \u043a\u0430\u043a \u0438 \u0434\u043e\u043b\u0436\u0435\u043d:<\/p>\n<pre><code class=\"xml\">[vagrant@node ~]$ klist -kt ip.keytab Keytab name: FILE:ip.keytab KVNO Timestamp       Principal ---- ------------------- ------------------------------------------------------    4 12\/31\/1969 19:00:00 postgres\/192.168.33.10@EXAMPLE.COM [vagrant@node ~]$ klist -kt node.keytab Keytab name: FILE:node.keytab KVNO Timestamp       Principal ---- ------------------- ------------------------------------------------------    3 12\/31\/1969 19:00:00 postgres\/node.example.com@EXAMPLE.COM<\/code><\/pre>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u043c \u0434\u0432\u0430 \u0444\u0430\u0439\u043b\u0430 \u043a\u043b\u044e\u0447\u0435\u0439 \u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u043d\u043e\u0432\u0430:<\/p>\n<pre><code class=\"xml\">[vagrant@node ~]$ ktutil ktutil:  read_kt ip.keytab ktutil:  read_kt node.keytab ktutil:  list slot KVNO Principal ---- ---- ---------------------------------------------------------------------    14   postgres\/192.168.33.10@EXAMPLE.COM    23postgres\/node.example.com@EXAMPLE.COM ktutil:  write_kt postgres.keytab ktutil:  exit<\/code><\/pre>\n<pre><code class=\"xml\">[vagrant@node ~]$ klist -kt postgres.keytab Keytab name: FILE:postgres.keytab KVNO Timestamp       Principal ---- ------------------- ------------------------------------------------------    4 06\/03\/2020 14:21:20 postgres\/192.168.33.10@EXAMPLE.COM    3 06\/03\/2020 14:21:20 postgres\/node.example.com@EXAMPLE.COM<\/code><\/pre>\n<pre><code class=\"xml\">chmod 600 postgres.keytab export KRB5_KTNAME=postgres.keytab<\/code><\/pre>\n<p>  \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u043a\u0430\u0442\u043d\u044b\u0439 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a, \u0447\u0442\u043e\u0431\u044b \u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u043f\u0435\u0440\u0435\u0448\u0451\u043b \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043d\u043e\u0432\u044b\u043c \u0444\u0430\u0439\u043b\u043e\u043c \u043a\u043b\u044e\u0447\u0435\u0439:<\/p>\n<pre><code class=\"xml\">vagrant@node ~]$ psql \"postgresql:\/\/node.example.com:26257\/defaultdb?sslmode=require\" -U pguser psql (9.5.22, server 9.5.0) SSL connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES128-GCM-SHA256, bits: 128, compression: off) Type \"help\" for help.   defaultdb=><\/code><\/pre>\n<p>  \u0423 \u043d\u0430\u0441 \u0438 \u043f\u0440\u0430\u0432\u0434\u0430 \u0435\u0441\u0442\u044c \u0441\u0443\u0431\u044a\u0435\u043a\u0442 \u0441 IP-\u0430\u0434\u0440\u0435\u0441\u043e\u043c 192.168.33.10. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043a \u043d\u0435\u043c\u0443 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f:<\/p>\n<pre><code class=\"xml\">[vagrant@node ~]$ psql \"postgresql:\/\/192.168.33.10:26257\/defaultdb?sslmode=require\" -U pguser psql: could not connect to server: Connection refused     Is the server running on host \"192.168.33.10\" and accepting     TCP\/IP connections on port 26257?<\/code><\/pre>\n<p>  \u041f\u0440\u0438\u0447\u0438\u043d\u0430 \u043e\u0448\u0438\u0431\u043a\u0438 \u2014 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0443\u0437\u0435\u043b \u0431\u044b\u043b \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b &#8212;<code>-listen-addr=node.example.com:26257<\/code>. \u0427\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0435\u0433\u043e, \u044f \u0432\u0432\u043e\u0436\u0443 <code>--listen-addr=192.168.33.10:26257<\/code>.<\/p>\n<p>  \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u0435\u0449\u0451 \u0440\u0430\u0437:<\/p>\n<pre><code class=\"xml\">[vagrant@node ~]$ psql \"postgresql:\/\/192.168.33.10:26257\/defaultdb?sslmode=require\" -U pguser psql (9.5.22, server 9.5.0) SSL connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES128-GCM-SHA256, bits: 128, compression: off) Type \"help\" for help.   defaultdb=><\/code><\/pre>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c! \u042d\u0442\u043e\u0442 IP \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438 \u0434\u043b\u044f \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438.<\/p>\n<h2><font color=\"#076184\">\u0412\u0430\u0436\u043d\u043e\u0435 \u043f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435<\/font><\/h2>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0435\u0436\u0438\u043c\u0430 <code>sslmode=require<\/code> \u0441\u043e\u043f\u0440\u044f\u0436\u0435\u043d\u043e \u0441 \u0440\u0438\u0441\u043a\u043e\u043c \u0430\u0442\u0430\u043a\u0438 MITM (Man In The Middle). \u0412 \u0441\u0432\u044f\u0437\u0438 \u0441 \u044d\u0442\u0438\u043c \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <code>verify-ca<\/code> \u0438\u043b\u0438 <code>verify-full<\/code>.<\/p>\n<p>  <code>verify-ca<\/code> \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u0435\u0435 \u0432 \u043f\u043b\u0430\u043d\u0435 \u0430\u0442\u0430\u043a MITM, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0447\u0435\u0440\u0435\u0437 \u0438\u0437\u0434\u0430\u0442\u0435\u043b\u044f \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430:<\/p>\n<pre><code class=\"xml\">psql \"postgresql:\/\/node.example.com:26257\/defaultdb?sslmode=verify-ca&amp;sslrootcert=certs\/ca.crt\" -U pguser<\/code><\/pre>\n<p>  <code>verify-full<\/code> \u0432 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043a \u044d\u0442\u043e\u043c\u0443 \u0435\u0449\u0451 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 Common Name (\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0435 \u0438\u043c\u044f) \u043d\u0430 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430:<\/p>\n<pre><code class=\"xml\">psql \"postgresql:\/\/node.example.com:26257\/defaultdb?sslmode=verify-full&amp;sslrootcert=certs\/ca.crt\" -U pguser<\/code><\/pre>\n<p>  \u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u043d\u043e \u0432 <a href=\"https:\/\/www.postgresql.org\/docs\/9.5\/libpq-ssl.html\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>.<\/p>\n<hr\/>\n<p>  \u041d\u041b\u041e \u043f\u0440\u0438\u043b\u0435\u0442\u0435\u043b\u043e \u0438 \u043e\u0441\u0442\u0430\u0432\u0438\u043b\u043e \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u043c\u043e\u043a\u043e\u0434\u044b \u0434\u043b\u044f \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0435\u0439 \u043d\u0430\u0448\u0435\u0433\u043e \u0431\u043b\u043e\u0433\u0430:<\/p>\n<p>   \u2014 <a href=\"https:\/\/firstvds.ru\/?utm_source=habr&amp;utm_medium=article&amp;utm_campaign=product&amp;utm_content=vds15exeptprogrev\">15% \u043d\u0430 \u0432\u0441\u0435 \u0442\u0430\u0440\u0438\u0444\u044b VDS<\/a> (\u043a\u0440\u043e\u043c\u0435 \u0442\u0430\u0440\u0438\u0444\u0430 \u041f\u0440\u043e\u0433\u0440\u0435\u0432) \u2014 <b><font color=\"#163C51\">HABRFIRSTVDS<\/font><\/b>.<\/p>\n<p>   \u2014 <a href=\"https:\/\/1dedic.ru\/?utm_source=habr&amp;utm_medium=article&amp;utm_campaign=product&amp;utm_content=coreryzen20#server_configurator\"> 20% \u043d\u0430 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u044b AMD Ryzen \u0438 Intel Core <\/a>\u2014 <b><font color=\"#163C51\">HABRFIRSTDEDIC<\/font><\/b>.<\/div>\n<\/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\/company\/first\/blog\/598099\/\"> https:\/\/habr.com\/ru\/company\/first\/blog\/598099\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\" class=\"article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/su\/rq\/9f\/surq9ffkkxtrupqt8wqnseipe3k.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/su\/rq\/9f\/surq9ffkkxtrupqt8wqnseipe3k.jpeg\" data-blurred=\"true\"\/><\/div>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u043f\u043e\u0441\u0442\u0435 \u0440\u0430\u0441\u043a\u0440\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043e\u0441\u043d\u043e\u0432\u044b \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0421\u0423\u0411\u0414 CockroachDB \u0441 Active Directory. AD \u2014 \u043a\u043e\u043c\u043c\u0435\u0440\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u043e\u0431\u0440\u0430\u0442\u0438\u043c Kerberos, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0439 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0435\u0439 Microsoft.<\/p>\n<p>  \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043f\u0440\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e CockroachDB \u0441 Active Directory. \u0412 \u043e\u0441\u043d\u043e\u0432\u0435 \u0440\u0430\u0431\u043e\u0442\u044b Cockroach \u043b\u0435\u0436\u0438\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 <a href=\"https:\/\/www.cockroachlabs.com\/docs\/stable\/gssapi_authentication.html\">GSSAPI<\/a>. \u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f Cockroach \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u0410 \u0432\u043e\u0442 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f (OU) AD \u0441 \u0440\u043e\u043b\u044f\u043c\u0438 \u0432 Cockroach \u2014 \u0443\u0436\u0435 \u043d\u0435\u0442.  <\/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-326875","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/326875","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=326875"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/326875\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=326875"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=326875"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=326875"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}