{"id":1480,"date":"2019-10-29T10:31:19","date_gmt":"2019-10-29T01:31:19","guid":{"rendered":"https:\/\/knowhow.hirohiro716.com\/?p=1480"},"modified":"2022-05-03T13:29:16","modified_gmt":"2022-05-03T04:29:16","slug":"freeipa%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bc%e3%81%8b%e3%82%89ipa%e3%83%a6%e3%83%bc%e3%82%b6%e3%83%bc%e3%81%a8windows10%e3%81%ae%e3%83%ad%e3%83%bc%e3%82%ab%e3%83%ab%e3%83%a6%e3%83%bc%e3%82%b6%e3%83%bc","status":"publish","type":"post","link":"https:\/\/weblog.hirohiro716.com\/?p=1480","title":{"rendered":"Windows10\u306b\u3059\u3079\u3066\u306eFreeIPA\u30e6\u30fc\u30b6\u30fc\u3068\u540c\u540d\u306e\u30ed\u30fc\u30ab\u30eb\u30e6\u30fc\u30b6\u30fc\u3092\u4f5c\u6210\u3059\u308b"},"content":{"rendered":"<h4>\u524d\u63d0\u6761\u4ef6<\/h4>\n<p><a href=\"https:\/\/knowhow.hirohiro716.com\/?p=1775\">\u3053\u306e\u624b\u9806<\/a>\u3067\u8a2d\u5b9a\u3057\u305fIPA\u30b5\u30fc\u30d0\u30fc\u3001<a href=\"https:\/\/knowhow.hirohiro716.com\/?p=1473\">\u3053\u306e\u624b\u9806<\/a>\u3067\u8a2d\u5b9a\u3057\u305fWindows10\u3092\u4f7f\u7528\u3059\u308b\u3002<\/p>\n<pre class=\"brush: plain; gutter: false; title: ; notranslate\" title=\"\">\r\n\u30fb IPA\u30b5\u30fc\u30d0\u30fc\u3067\u306fexpect\u30b3\u30de\u30f3\u30c9\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6e08\u307f\r\n\u30fb Windows10\u306b\u306f\u8a2d\u5b9a\u304b\u3089sshd\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6e08\u307f\r\n<\/pre>\n<h4>\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u6d41\u308c<\/h4>\n<pre class=\"brush: plain; gutter: false; title: ; notranslate\" title=\"\">\r\n\u2460 FreeIPA\u30b5\u30fc\u30d0\u30fc\u3067\u3059\u3079\u3066\u306eIPA\u30e6\u30fc\u30b6\u30fc\u3092\u53d6\u5f97\u3057\u3066\u30ab\u30f3\u30de\u533a\u5207\u308a\u306b\u52a0\u5de5\u3059\u308b\r\n\u2461 expect\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066Windows\u306bssh\u3067\u63a5\u7d9a\u3059\u308b\r\n\u2462 Windows\u4e0a\u3067\u30e6\u30fc\u30b6\u30fc\u306e\u8ffd\u52a0\u3092\u884c\u3046\u30b9\u30af\u30ea\u30d7\u30c8\u306b\u300c\u2460\u300d\u3067\u53d6\u5f97\u3057\u305f\u30e6\u30fc\u30b6\u30fc\u30ea\u30b9\u30c8\u3092\u9001\u4fe1\u3059\u308b\r\n<\/pre>\n<h4>IPA\u30b5\u30fc\u30d0\u30fc\u306e\u30b9\u30af\u30ea\u30d7\u30c8<\/h4>\n<p>cron\u3067\u5b9a\u671f\u7684\u306b\u5b9f\u884c\u3059\u308b\u3068Windows\u306e\u7ba1\u7406\u304c\u5c11\u3057\u697d\u306b\u306a\u308b\u304b\u3082\u3057\u308c\u306a\u3044\u3002<br \/>\nWindows\u306e\u53f0\u6570\u304c\u591a\u3044\u5834\u5408\u306fsamba4\u306eActiveDirectory\u4f7f\u3063\u305f\u307b\u3046\u304c\u826f\u3044\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n#!\/bin\/bash\r\n\r\n# Kerberos\u30e6\u30fc\u30b6\u30fc\u3092\u3059\u3079\u3066\u53d6\u5f97\u3059\u308b\r\n# IPA\u30e6\u30fc\u30b6\u30fc\u4ee5\u5916\u3067\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u3044\u308b\u5834\u5408\u306fkinit\u304c\u5fc5\u8981\r\n# echo 'password' | kinit admin\r\nUSERS=`ipa user-find | grep &quot;User login:*&quot; | sed &quot;s\/  User login: \/\/g&quot; | sed -z &quot;s\/\\n\/,\/g&quot;`\r\n\r\n# Windows\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306bssh\u3067\u63a5\u7d9a\u3057\u3066\u5c02\u7528bat\u30d5\u30a1\u30a4\u30eb\u3092\u5b9f\u884c\u3059\u308b\r\n# Windows\u306eIP\u30a2\u30c9\u30ec\u30b9\u306f192.168.0.100\r\n# Administrator\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u306f12345678\r\nHOST=&quot;192.168.0.100&quot;\r\nexpect -c &quot;\r\n\tspawn ssh administrator@$HOST\r\n\texpect \\&quot;password:\\&quot;\r\n\tsend 12345678\\\\n\r\n\texpect \\&quot;Microsoft Windows\\&quot;\r\n\tsend \\&quot;C:\\\\\\\\Script\\\\\\\\UpdateUserAccounts.bat \\\\\\&quot;$USERS\\\\\\&quot;\\r\\n\\&quot;\r\n\texpect \\&quot;\u30e6\u30fc\u30b6\u30fc\u30ea\u30b9\u30c8\u306e\u66f4\u65b0\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002\\&quot;\r\n\tsend exit\\r\\n\r\n\tinteract\r\n&quot;\r\n<\/pre>\n<h4>Windows10\u306e\u30b9\u30af\u30ea\u30d7\u30c8<\/h4>\n<p>\u3053\u3053\u3067\u306f\u30ed\u30fc\u30ab\u30eb\u306b\u30b9\u30af\u30ea\u30d7\u30c8\u7f6e\u3044\u3066\u308b\u3051\u3069\u3001samba\u5171\u6709\u306b\u7f6e\u3044\u305f\u65b9\u304c\u7ba1\u7406\u3057\u3084\u3059\u3044\u304b\u3082\u3002<\/p>\n<pre class=\"brush: plain; title: C:\\Script\\add-user-accounts.bat; notranslate\" title=\"C:\\Script\\add-user-accounts.bat\">\r\n:# \u203b\u5f15\u6570\u3068\u3057\u3066\u6e21\u3055\u308c\u308b\u30e6\u30fc\u30b6\u30fc\u30ea\u30b9\u30c8\u306f\u30ab\u30f3\u30de\u533a\u5207\u308a\u3067\u672b\u5c3e\u306b\u3082\u30ab\u30f3\u30de\u304c\u5fc5\u8981\r\n@echo off\r\nset parameters=%~1\r\nset domain=LOCAL.EXAMPLE.COM\r\n\r\nsetlocal enabledelayedexpansion\r\n\r\n:# \u5f15\u6570\u3067\u6e21\u3055\u308c\u305f\u30ea\u30b9\u30c8\u3067\u30ed\u30fc\u30ab\u30eb\u306b\u3044\u306a\u3044\u30e6\u30fc\u30b6\u30fc\u306e\u4f5c\u6210\r\n:# \u30d1\u30b9\u30ef\u30fc\u30c9\u306f\u5b9f\u969b\u306e\u30b5\u30a4\u30f3\u30a4\u30f3\u306b\u306f\u4f7f\u7528\u3055\u308c\u306a\u3044\u306e\u3067\u56fa\u5b9a\u5024\r\n:# \u30d1\u30b9\u30ef\u30fc\u30c9\u306e\u6709\u52b9\u671f\u9650\u3092\u7121\u671f\u9650\u306b\u3059\u308b\r\n:# \u300cRemote Desktop Users\u300d\u30b0\u30eb\u30fc\u30d7\u306b\u6240\u5c5e\u3055\u305b\u308b\r\nset password=87654321\r\nfor %%P in (%parameters%) do (\r\n\tnet user %%P 1&gt;NUL 2&gt;NUL\r\n\tif ERRORLEVEL == 1 (\r\n\t\tnet user %%P %password% \/add \/expires:never \/fullname:%%P@%domain% 1&gt;NUL\r\n\t\twmic useraccount where &quot;Name='%%P'&quot; set PasswordExpires=FALSE 1&gt;NUL\r\n\t\tnet localgroup &quot;Remote Desktop Users&quot; %%P \/add 1&gt;NUL\r\n\t)\r\n)\r\n\r\nendlocal\r\n\r\necho \u30e6\u30fc\u30b6\u30fc\u30ea\u30b9\u30c8\u306e\u66f4\u65b0\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u63d0\u6761\u4ef6 \u3053\u306e\u624b\u9806\u3067\u8a2d\u5b9a\u3057\u305fIPA\u30b5\u30fc\u30d0\u30fc\u3001\u3053\u306e\u624b\u9806\u3067\u8a2d\u5b9a\u3057\u305fWindows10\u3092\u4f7f\u7528\u3059\u308b\u3002 \u30fb IPA\u30b5\u30fc\u30d0\u30fc\u3067\u306fexpect\u30b3\u30de\u30f3\u30c9\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6e08\u307f \u30fb Windows10\u306b\u306f\u8a2d\u5b9a\u304b\u3089sshd\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6e08\u307f \u30b9 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27,14],"tags":[],"class_list":["post-1480","post","type-post","status-publish","format-standard","hentry","category-freeipa","category-windows"],"views":1643,"_links":{"self":[{"href":"https:\/\/weblog.hirohiro716.com\/index.php?rest_route=\/wp\/v2\/posts\/1480","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/weblog.hirohiro716.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/weblog.hirohiro716.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/weblog.hirohiro716.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/weblog.hirohiro716.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1480"}],"version-history":[{"count":18,"href":"https:\/\/weblog.hirohiro716.com\/index.php?rest_route=\/wp\/v2\/posts\/1480\/revisions"}],"predecessor-version":[{"id":2112,"href":"https:\/\/weblog.hirohiro716.com\/index.php?rest_route=\/wp\/v2\/posts\/1480\/revisions\/2112"}],"wp:attachment":[{"href":"https:\/\/weblog.hirohiro716.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1480"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/weblog.hirohiro716.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1480"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/weblog.hirohiro716.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1480"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}