{"id":808,"date":"2015-11-14T13:27:11","date_gmt":"2015-11-14T04:27:11","guid":{"rendered":"http:\/\/usg.mydns.jp\/?p=808"},"modified":"2015-11-14T16:56:31","modified_gmt":"2015-11-14T07:56:31","slug":"%ef%bc%94%ef%bc%89%e8%b6%85%e5%85%a5%e9%96%80%e3%80%80openssh%e3%82%bb%e3%82%ad%e3%83%a5%e3%83%aa%e3%83%86%e3%82%a3%e8%a8%ad%e5%ae%9a%e7%b7%a8","status":"publish","type":"post","link":"https:\/\/usg.mydns.jp\/?p=808","title":{"rendered":"\u8d85\u5165\u9580\u3000OpenSSH(\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u8a2d\u5b9a\u7de8)"},"content":{"rendered":"<p>\u3067\u306f\u3001\u8d85\u5165\u9580\u3000OpenSSH(Tera Term)\u306b\u623b\u308a\u307e\u3057\u3066<br \/>\n\u3053\u306evi\u3092\u4f7f\u3063\u3066\u3001\u7df4\u7fd2\u3092\u517c\u306d\u306a\u304c\u3089\u672c\u756a\u8a2d\u5b9a\u3068\u3044\u304d\u307e\u3057\u3087\u3046<\/p>\n<p>\u307e\u305a\u306f\u6700\u521d\u306b\u30ed\u30b0\u30a4\u30f3\u3059\u308b\u4e00\u822c\u30e6\u30fc\u30b6\u30fc\u3092\uff11\u3064\u4f5c\u308a\u307e\u3059<br \/>\n\u30e6\u30fc\u30b6\u30fc\u540d\u306fseito<br \/>\n<PRE># useradd seito<\/PRE><br \/>\n\u7d9a\u3044\u3066\u30e6\u30fc\u30b6\u30fcseito\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u306e\u8a2d\u5b9a<br \/>\n<PRE># passwd seito<\/PRE><br \/>\n\u30d1\u30b9\u30ef\u30fc\u30c9\u306f\u5171\u901a\u30eb\u30fc\u30eb\u3067\u4f5c\u6210\u3057\u3066\u304f\u3060\u3055\u3044<\/p>\n<p>seito\u30e6\u30fc\u30b6\u30fc\u304c\u4f5c\u6210\u3067\u304d\u307e\u3057\u305f\u3089<br \/>\nseito\u3078\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u307f\u307e\u3057\u3087\u3046<\/p>\n<p>exit\u3068\u5165\u529b\u3057\u3066\u4e00\u65e6TeraTerm\u3092\u7d42\u4e86\u3057<br \/>\n\u3082\u30461\u5ea6\u8d77\u52d5\u3057\u307e\u3059<\/p>\n<p>\u30db\u30b9\u30c8\u306eIP\u30a2\u30c9\u30ec\u30b9\u3092\u78ba\u8a8d\u3057\u3066OK\u3092\u30af\u30ea\u30c3\u30af\u3057<br \/>\nSSH\u8a8d\u8a3c\u3067\u30e6\u30fc\u30b6\u30fcseito\u3067\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u307f\u307e\u3057\u3087\u3046<\/p>\n<p><a href=\"http:\/\/usg.mydns.jp\/wp-content\/uploads\/2015\/11\/020.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/usg.mydns.jp\/wp-content\/uploads\/2015\/11\/020.jpg\" alt=\"020\" width=\"476\" height=\"462\" class=\"alignnone size-full wp-image-742\" srcset=\"https:\/\/usg.mydns.jp\/wp-content\/uploads\/2015\/11\/020.jpg 476w, https:\/\/usg.mydns.jp\/wp-content\/uploads\/2015\/11\/020-300x291.jpg 300w, https:\/\/usg.mydns.jp\/wp-content\/uploads\/2015\/11\/020-309x300.jpg 309w\" sizes=\"auto, (max-width: 476px) 100vw, 476px\" \/><\/a><\/p>\n<p>\u30ed\u30b0\u30a4\u30f3\u3067\u304d\u307e\u3057\u305f\u3067\u3057\u3087\u3046\u304b<\/p>\n<p>\u3067\u306f\u3001\u3053\u306e\u72b6\u614b\u3067root\u3078\u30ed\u30b0\u30a4\u30f3\u3057\u307e\u3059<br \/>\n<PRE>$ su<\/PRE><\/p>\n<p>root\u306b\u30ed\u30b0\u30a4\u30f3\u3067\u304d\u307e\u3057\u305f\u3067\u3057\u3087\u3046\u304b<\/p>\n<p>\u3067\u306f\u3001\u3053\u308c\u3088\u308assh\u4e00\u767a\u76eeroot\u30ed\u30b0\u30a4\u30f3\u306e\u7981\u6b62\u8a2d\u5b9a\u3092\u3057\u3066\u3044\u304d\u307e\u3059<\/p>\n<p>\u4ee5\u4e0b\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092vi\u3067\u958b\u3044\u3066\u307f\u307e\u3057\u3087\u3046<br \/>\n<PRE># vi \/etc\/ssh\/sshd_config<\/PRE><br \/>\nroot\u30ed\u30b0\u30a4\u30f3\u3092\u5236\u5fa1\u3057\u3066\u3044\u308b\u306e\u306f\u4ee5\u4e0b\u306e\u6587\u3067\u3059<br \/>\nPermitRootLogin yes<\/p>\n<p>root\u30ed\u30b0\u30a4\u30f3\u3000\uff1d\u3000yes<br \/>\n\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u306e\u3067\u3001root\u30ed\u30b0\u30a4\u30f3yes\u3068\u8a00\u3046\u8a2d\u5b9a\u306b\u306a\u3063\u3066\u3044\u307e\u3059<\/p>\n<p>\u3053\u308c\u3092root\u30ed\u30b0\u30a4\u30f3 = no \u3068\u8a00\u3046\u8a2d\u5b9a\u306b\u5909\u66f4\u3057\u307e\u3057\u3087\u3046<\/p>\n<p>\u30b3\u30de\u30f3\u30c9\u30e2\u30fc\u30c9\u3067[y][y]\u3067\u30b3\u30d4\u30fc<br \/>\n\u305d\u3057\u3066[p]\u3067\u8cbc\u308a\u4ed8\u3051<\/p>\n<p>PermitRootLogin yes<br \/>\nPermitRootLogin yes<\/p>\n<p>[i]\u3092\u62bc\u3057\u3066\u7de8\u96c6\u30e2\u30fc\u30c9\u306b\u3057\u307e\u3059<\/p>\n<p>#PermitRootLogin yes\u3000\u30b3\u30e1\u30f3\u30c8\u3057\u3066<br \/>\nPermitRootLogin no\u3000\u3068\u66f8\u304d\u63db\u3048\u307e\u3059<\/p>\n<p>[Esc]\u3067\u30b3\u30de\u30f3\u30c9\u30e2\u30fc\u30c9\u306b\u623b\u308a<br \/>\n:wq \u3067\u4fdd\u5b58\u7d42\u4e86<\/p>\n<p>\u8a2d\u5b9a\u304c\u7d42\u308f\u3063\u305f\u3089sshd\u3092\u518d\u8d77\u52d5\u3057\u307e\u3057\u3087\u3046<br \/>\n<PRE># systemctl restart sshd<\/PRE><\/p>\n<p>\u3053\u308c\u3067\u3001root\u30ed\u30b0\u30a4\u30f3\u304c\u51fa\u6765\u306a\u304f\u306a\u3063\u3066\u308b\u304b\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3057\u3087\u3046<\/p>\n<p>\u4e00\u65e6Tera Term\u3092\u518d\u8d77\u52d5\u3057<br \/>\nroot\u30ed\u30b0\u30a4\u30f3\u51fa\u6765\u307e\u3059\u3067\u3057\u3087\u3046\u304b<\/p>\n<p>\u3053\u306e\u4ed6\u306b\u3082ssh\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u3092\u4e0a\u3052\u308b\u65b9\u6cd5\u304c\u3044\u304f\u3064\u304b\u3042\u308a\u307e\u3059<\/p>\n<p>\u30dd\u30fc\u30c8\u756a\u53f7\u304c\u30c7\u30d5\u30a9\u30eb\u30c8\u306722\u3067\u3059\u304c\u3001\u3053\u308c\u3092\u5909\u66f4\u3057\u305f\u308a<br \/>\nfail2ban\u3068\u8a00\u3046\u30b5\u30fc\u30d3\u30b9\u3092\u5c0e\u5165\u3057\u305f\u308a<\/p>\n<p>fail2ban\u306f\u4e00\u5b9a\u56de\u6570\u8a8d\u8a3c\u304c\u5931\u6557\u3057\u305f\u5834\u5408\u3001<br \/>\n\u8a8d\u8a3c\u3092\u8a66\u307f\u308bip\u30a2\u30c9\u30ec\u30b9\u3092\u4e00\u5b9a\u6642\u9593\u906e\u65ad\u3057\u307e\u3059<\/p>\n<p>\u30d1\u30b9\u30ef\u30fc\u30c9\u7dcf\u30a2\u30bf\u30c3\u30af\u3092\u8a66\u307f\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u306b\u6709\u52b9\u306a\u30b5\u30fc\u30d3\u30b9\u3067\u3057\u3087\u3046<\/p>\n<p>\u305d\u306e\u307b\u304b\u306b\u3082\u69d8\u3005\u3042\u308a\u307e\u3059\u304c<br \/>\n\u305d\u308c\u306f\u307e\u305f\u5225\u306e\u6a5f\u4f1a\u3067<\/p>\n<p>\u3053\u308c\u3067\u3001\u5b89\u5168\u306a\u30ea\u30e2\u30fc\u30c8\u30ed\u30b0\u30a4\u30f3\u304c\u3068\u308a\u3042\u3048\u305a\u78ba\u7acb\u3057\u307e\u3057\u305f<\/p>\n<p>\u3067\u306f\u3001\u3082\u3046\u5c11\u3057ssh\u306b\u3064\u3044\u3066\u3084\u3063\u3066\u884c\u304d\u307e\u3057\u3087\u3046<\/p>\n<p>\u4eca\u306e\u8a2d\u5b9a\u306f\u5916\u90e8\u304b\u3089ssh\u3067\u4e00\u822c\u30e6\u30fc\u30b6\u30fc\u3067\u30ed\u30b0\u30a4\u30f3\u3057<br \/>\n\u305d\u306e\u5f8c\u3001root\u3078\u30ed\u30b0\u30a4\u30f3\u3057\u307e\u3057\u305f<\/p>\n<p>ssh\u306f\u4f55\u3082\u5916\u90e8\u304b\u3089\u63a5\u7d9a\u3059\u308b\u3060\u3051\u3067\u306a\u304f<br \/>\n\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u5185\u306e\u30b5\u30fc\u30d0\u30fc\u540c\u58eb\u306b\u63a5\u7d9a\u3057\u305f\u308a<br \/>\n\u3042\u308b\u3044\u306f\u3001\u30ed\u30fc\u30ab\u30eb\u30de\u30b7\u30f3\u306e\u4e2d\u3067\u3082ssh\u63a5\u7d9a\u304c\u51fa\u6765\u3066\u3057\u307e\u3046\u3093\u3067\u3059<\/p>\n<p>\u3067\u306froot\u304b\u3089seito\u3078ssh\u63a5\u7d9a\u3057\u3066\u307f\u307e\u3057\u3087\u3046<br \/>\n# ssh \u4e00\u822c\u30e6\u30fc\u30b6\u30fc\u540d\u3000@ \u63a5\u7d9a\u5148\u306e\u30db\u30b9\u30c8\uff08IP\u30a2\u30c9\u30ec\u30b9\u306a\u3069\uff09<br \/>\n<PRE># ssh seito@localhost<\/PRE><\/p>\n<p>\u4e00\u756a\u6700\u521d\u306b\u63a5\u7d9a\u3057\u305f\u5834\u5408\u3001\u306a\u308a\u3059\u307e\u3057\u63a5\u7d9a\u3092\u9632\u6b62\u3059\u308b\u305f\u3081<br \/>\n\u3053\u306e\u30db\u30b9\u30c8\u3092\u4fe1\u7528\u3059\u308b\u304b\u78ba\u8a8d\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u3067\u307e\u3059<\/p>\n<p>\u30fb\u30fb\u30fb<br \/>\nAre you sure you want to contine connecting (yes\/no)?<\/p>\n<p>\u300cyes\u300d\u3067\u8fd4\u3057\u307e\u3057\u3087\u3046<\/p>\n<p>Warning: Pemanently added &#8216;XXX.XXX.XXX.XXX&#8217; (RSA) to the list of known hosts.<br \/>\nseito@localhost&#8217;s password:<br \/>\n\u30e6\u30fc\u30b6\u30fcseito\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5165\u529b\u3057\u307e\u3059<br \/>\n\u3053\u308c\u3067\u3001\u63a5\u7d9a\u5148\u306e\u30db\u30b9\u30c8\u8a8d\u8a3c\u9375\u304c\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u5074\u306b\u767b\u9332\u3055\u308c\u307e\u3057\u305f<\/p>\n<p>\u6b21\u56de\u304b\u3089\u306f\u3001\u3053\u306e\u8a8d\u8a3c\u9375\u3092\u4f7f\u3063\u3066\u30b5\u30fc\u30d0\u30fc\u5074\u306e\u30da\u30a2\u9375\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u3053\u3068\u3092\u8868\u3057\u3066\u3044\u307e\u3059<\/p>\n<p>\u30ed\u30b0\u30a4\u30f3\u304c\u6210\u529f\u3059\u308b\u3068<br \/>\n[\u4e00\u822c\u30e6\u30fc\u30b6\u30fc@\u30db\u30b9\u30c8] $ \u306b\u5909\u308f\u3063\u3066\u3044\u308b\u306e\u304c\u89e3\u308b\u3068\u601d\u3044\u307e\u3059<\/p>\n<p>root\u3067\u30ed\u30b0\u30a4\u30f3\u3057\u3001\u3055\u3089\u306b\u4e00\u822c\u30e6\u30fc\u30b6\u30fc\u3078\u30ed\u30b0\u30a4\u30f3\u3057<br \/>\n\u3084\u308d\u3046\u3068\u601d\u3048\u3070\u3001\u3053\u3053\u304b\u3089\u5225\u30e6\u30fc\u30b6\u30fc\u3078\u30ed\u30b0\u30a4\u30f3\u3057\u305f\u308a\u30fb\u30fb\u30fb<\/p>\n<p>\u3061\u3087\u3063\u3068\u3084\u3063\u3066\u307f\u307e\u3057\u3087\u3046<br \/>\n\u30e6\u30fc\u30b6\u30fc\u3092\u5207\u308a\u66ff\u3048\u308b\u30b3\u30de\u30f3\u30c9\u306f\u3000su<br \/>\n<PRE>$ SU<br \/>\nPassword<\/PRE><\/p>\n<p>\u3053\u308c\u3092\u307b\u3063\u3068\u304f\u3068<br \/>\n2\u91cd3\u91cd\u3068\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u3044\u304f\u306e\u3067<br \/>\n\u3069\u3093\u3069\u3093\u52d5\u4f5c\u304c\u91cd\u304f\u306a\u3063\u3066\u3044\u304d\u307e\u3059<\/p>\n<p>\u73fe\u5728\u306e\u30e6\u30fc\u30b6\u30fc\u304b\u3089\u30ed\u30b0\u30a2\u30a6\u30c8\u3057\u305f\u3044\u6642\u306f\u300cexit\u300d\u3068\u5165\u529b\u3059\u308c\u3070<br \/>\n\uff11\u3064\u524d\u306e\u30e6\u30fc\u30b6\u30fc\u306b\u623b\u308a\u307e\u3059<\/p>\n<p>\u307e\u305f\u3001ssh\u63a5\u7d9a\u304b\u3089\u629c\u3051\u308b\u3068\u304d\u3082\u300cexit\u300d\u3068\u5165\u529b\u3057\u307e\u3059<\/p>\n<p>\u3053\u308c\u304cssh\u306e\u5927\u307e\u304b\u306a\u52d5\u4f5c\u3067\u3059<\/p>\n<p>Linux\u540c\u58eb\u3084MacOS\u306a\u3069\u306f\u30bf\u30fc\u30df\u30ca\u30eb\u540c\u58eb\u3067\u306f\u3001\u3053\u3046\u3057\u305f\u63a5\u7d9a\u304c\u53ef\u80fd\u3067\u3059\u304c<br \/>\nWindows\u306e\u5834\u5408\u3001\u30bf\u30fc\u30df\u30ca\u30eb\u304c\u3042\u308a\u307e\u305b\u3093\u306e\u3067<br \/>\nssh\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u30bd\u30d5\u30c8\uff1d\u300cTeraTerm\u300d\u3092\u4f7f\u3044\u307e\u3059<\/p>\n<p>\u305d\u3057\u3066\u3001\u3053\u306essh\u3092\u4f7f\u3046\u3053\u3068\u304c\u51fa\u6765\u308b\u306a\u3089<br \/>\n\u5916\u90e8\u304b\u3089\u306e\u63a5\u7d9a\u3067\u3001\u307b\u307c\u3059\u3079\u3066\u306e\u30b5\u30fc\u30d0\u30fc\u3092\u69cb\u7bc9\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3059<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3067\u306f\u3001\u8d85\u5165\u9580\u3000OpenSSH(Tera Term)\u306b\u623b\u308a\u307e\u3057\u3066 \u3053\u306evi\u3092\u4f7f\u3063\u3066 &hellip; <a href=\"https:\/\/usg.mydns.jp\/?p=808\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"gallery","meta":{"footnotes":""},"categories":[14,15],"tags":[],"class_list":["post-808","post","type-post","status-publish","format-gallery","hentry","category-linux","category-15","post_format-post-format-gallery"],"_links":{"self":[{"href":"https:\/\/usg.mydns.jp\/index.php?rest_route=\/wp\/v2\/posts\/808","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/usg.mydns.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/usg.mydns.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/usg.mydns.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/usg.mydns.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=808"}],"version-history":[{"count":4,"href":"https:\/\/usg.mydns.jp\/index.php?rest_route=\/wp\/v2\/posts\/808\/revisions"}],"predecessor-version":[{"id":828,"href":"https:\/\/usg.mydns.jp\/index.php?rest_route=\/wp\/v2\/posts\/808\/revisions\/828"}],"wp:attachment":[{"href":"https:\/\/usg.mydns.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=808"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/usg.mydns.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=808"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/usg.mydns.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=808"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}