{"id":116,"date":"2009-09-14T20:04:05","date_gmt":"2009-09-14T11:04:05","guid":{"rendered":"https:\/\/hiro7216.mydns.jp\/blog\/?p=116"},"modified":"2024-01-30T23:21:22","modified_gmt":"2024-01-30T14:21:22","slug":"ssh%e3%81%a7%e3%81%ae%e3%83%9b%e3%82%b9%e3%83%88%e5%88%b6%e9%99%90","status":"publish","type":"post","link":"https:\/\/hiro7216.mydns.jp\/blog\/?p=116","title":{"rendered":"SSH\u3067\u306e\u30db\u30b9\u30c8\u5236\u9650"},"content":{"rendered":"\n<p>SSH\u3067\u5916\u304b\u3089\u63a5\u7d9a\u51fa\u6765\u308b\u3068\u4f55\u304b\u3068\u4fbf\u5229\u3067\u3059\u3002<br>\u3057\u304b\u3057\u3001\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u7684\u306b\u306f\u3042\u307e\u308a\u826f\u304f\u3042\u308a\u307e\u305b\u3093\u3002<br>\u79d8\u5bc6\u9375\u306e\u5229\u7528\u3084\u3001SSH\u30dd\u30fc\u30c8\u756a\u53f7\u306e\u5909\u66f4\u306f\u5f53\u7136\u3067\u3059\u304c<br>\u305d\u308c\u3067\u3082\u30a2\u30bf\u30c3\u30af\u3057\u3066\u304f\u308b\u5974\u306f\u3044\u308b\u3082\u306e\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u79c1\u306f\u30a2\u30bf\u30c3\u30af\u304c\u591a\u3044\u56fd\u306eIP\u3092iptables\u3067\u898f\u5236\u3057\u3066\u3044\u307e\u3059\u3002<br>\uff08\u5f53\u7136\u306a\u304c\u3089\u305d\u306e\u56fd\u306eIP\u304b\u3089\u306f\u5168\u304f\u7e4b\u304c\u308a\u307e\u305b\u3093\uff09<br>\u3053\u306e\u5bfe\u5fdc\u3067\u30a2\u30bf\u30c3\u30af\u81ea\u4f53\u306f\u304b\u306a\u308a\u6e1b\u3089\u3059\u3053\u3068\u304c\u51fa\u6765\u307e\u3057\u305f\u3002<br><span style=\"color: blue;\">\u203b\u8a73\u3057\u304f\u306fblog\u5185\u306b\u66f8\u3044\u3066\u307e\u3059\u3002<\/span><\/p>\n\n\n\n<p>\u305d\u308c\u3067\u3082\u7a00\u306b\u30a2\u30bf\u30c3\u30af\u306f\u3042\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<br>\u3088\u308a\u5b89\u5168\u306b\u3059\u308b\u305f\u3081\u306bSSH\u306b\u63a5\u7d9a\u51fa\u6765\u308bIP\u3092\u898f\u5236\u3057\u307e\u3059\u3002<br>\uff08\u4f1a\u793e\u306a\u3069\u3067\u56fa\u5b9aIP\u304c\u3042\u308b\u5834\u5408\u3067\u7121\u3044\u3068\u6709\u52b9\u306b\u306f\u51fa\u6765\u307e\u305b\u3093\u304c\uff09<\/p>\n\n\n\n<p>\u7de8\u96c6\u3059\u308b\u30d5\u30a1\u30a4\u30eb\u306f\u4ee5\u4e0b\u3068\u306a\u308a\u307e\u3059\u3002<br>\/etc\/hosts.allow<\/p>\n\n\n\n<p>\u5f53\u7136\u306a\u304c\u3089\u30ed\u30fc\u30ab\u30eb\u306e\u63a5\u7d9a\u306f\u8a31\u53ef\u3068\u306a\u308a\u307e\u3059\u3002<br>sshd : 192.168. : ALLOW<\/p>\n\n\n\n<p>\u8907\u6570\u306eIP\u3092\u767b\u9332\u3059\u308b\u5834\u5408\u306f\u3001\u30b9\u30da\u30fc\u30b9\u3067\u533a\u5207\u3063\u3066\u767b\u9332\u3057\u307e\u3059\u3002<br>\uff08\u6700\u5f8c\u306e: ALLOW\u306f\u7121\u304f\u3066\u3082\u69cb\u3044\u307e\u305b\u3093\uff09<br>sshd : 192.168. \u3000xxx.xxx.xxx.xxx: ALLOW<\/p>\n\n\n\n<p>\u305d\u308c\u4ee5\u5916\u306f\u62d2\u5426\u3057\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u306e\u3067<br>\/etc\/hosts.deny\u306bsshd: ALL\u3068\u66f8\u304d\u52a0\u3048\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u500b\u4eba\u7684\u306b\u306f\u9762\u5012\u81ed\u304c\u308a\u306a\u306e\u3067<br>\/etc\/hosts.allow\u306b\u62d2\u5426\u306e\u884c\u307e\u3067\u66f8\u304d\u52a0\u3048\u307e\u3059\uff08\u7b11\uff09<br>sshd: ALL : deny<\/p>\n\n\n\n<p>\u8a31\u53ef\u30fb\u975e\u8a31\u53ef\u306e\u30eb\u30fc\u30eb\u306f\u30d5\u30a1\u30a4\u30eb\u5185\u3067\u306f\u4e0a\u304b\u3089\u4e00\u81f4\u3059\u308b\u307e\u3067<br>\u30d5\u30a1\u30a4\u30eb\u306e\u512a\u5148\u9806\u4f4d\u306f\/etc\/hosts.allow\u304b\u3089\/etc\/hosts.deny\u3078\u3068\u89e3\u91c8\u3055\u308c\u307e\u3059\u3002<br>\u3069\u3061\u3089\u306b\u3082\u4e00\u81f4\u3057\u306a\u304b\u3063\u305f\u5834\u5408\u306f\u8a31\u53ef\u3068\u306a\u308a\u307e\u3059\u306e\u3067\/etc\/hosts.deny\u306e\u6700\u5f8c\u306b<br>\u6b21\u306e\u4e00\u884c\u3092\u8ffd\u52a0\u3057\u3066\u304a\u304f\u3053\u3068\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\u3002<br>ALL : ALL : deny<\/p>\n\n\n\n<p>\u307e\u305fsshd\u306b\u30a2\u30af\u30bb\u30b9\u304c\u3042\u3063\u305f\u5834\u5408\u306b\u30e1\u30fc\u30eb\u3092\u9001\u308b\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002<br><span style=\"color: red;\">\u203b\u30e1\u30fc\u30eb\u3092\u9001\u4fe1\u51fa\u6765\u308b\u74b0\u5883\u306e\u5834\u5408\u3067\u3059\u3002<\/span><br>\u4e0b\u306b\u30b5\u30f3\u30d7\u30eb\u3092\u66f8\u3044\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p># for sshd local access<br>sshd : 192.168. : ALLOW<br># for sshd etc access with mail<br>sshd : xxx.xxx.xxx.xxx : spawn ( \/usr\/bin\/mail -s &#8220;sshd connected from %h&#8221; yourname@yourmail.com) &amp;<\/p>\n\n\n\n<p>\u4e0a\u306e\u884c\u304c192.168\u304b\u3089\u59cb\u307e\u308b\u30a2\u30c9\u30ec\u30b9\u3092\u8a31\u53ef\uff08\u30e1\u30fc\u30eb\u306f\u9001\u3089\u308c\u307e\u305b\u3093\uff09<br>\u4e0b\u306e\u884c\u304cxxx.xxx.xxx.xxx\u304b\u3089\u30a2\u30af\u30bb\u30b9\u304c\u3042\u3063\u305f\u5834\u5408\u306b\u8a31\u53ef\u3057\u307e\u3059\u304c\u3001\u540c\u6642\u306b\u30e1\u30fc\u30eb\u3092\u9001\u4fe1\u3057\u307e\u3059\u3002<br><span style=\"color: blue;\">\u203b\u30dd\u30fc\u30c8\u3078\u306e\u63a5\u7d9a\u81ea\u4f53\u306e\u8a31\u53ef\u3067\u3042\u3063\u3066\u3001SSH\u306e\u8a8d\u8a3c\u306f\u5f53\u7136\u5fc5\u8981\u3067\u3059\u3002<\/span><br>&#8220;sshd connected from %h&#8221;\u306e\u90e8\u5206\u304c\u30e1\u30fc\u30eb\u306e\u4ef6\u540d\u3068\u3057\u3066\u9001\u3089\u308c\u3066\u304d\u307e\u3059\u3002<br>%h\u306f\u63a5\u7d9a\u3057\u3066\u304d\u305f\u30db\u30b9\u30c8\u540d\uff08\u53c8\u306fIP\uff09\u306b\u7f6e\u304d\u63db\u3048\u3089\u308c\u3066\u9001\u4fe1\u3055\u308c\u307e\u3059\u3002<br>yourname@yourmail.com\u306f\u9001\u4fe1\u5148\u306e\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3068\u306a\u308a\u307e\u3059\u3002<br><span style=\"color: red;\">\u203b\u6a19\u6e96\u306e25\u756a\u30dd\u30fc\u30c8\u3092\u958b\u3051\u3066\u4f7f\u3046\u306e\u306f\u3001\u304b\u306a\u308a\u306e\u78ba\u7387\u3067\u30a2\u30bf\u30c3\u30af\u3092\u53d7\u3051\u308b\u306e\u3067\u304a\u52e7\u3081\u3057\u307e\u305b\u3093\u3002<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>SSH\u3067\u5916\u304b\u3089\u63a5\u7d9a\u51fa\u6765\u308b\u3068\u4f55\u304b\u3068\u4fbf\u5229\u3067\u3059\u3002\u3057\u304b\u3057\u3001\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u7684\u306b\u306f\u3042\u307e\u308a\u826f\u304f\u3042\u308a\u307e\u305b\u3093\u3002\u79d8\u5bc6\u9375\u306e\u5229\u7528\u3084\u3001SSH\u30dd\u30fc\u30c8\u756a\u53f7\u306e\u5909\u66f4\u306f\u5f53\u7136\u3067\u3059\u304c\u305d\u308c\u3067\u3082\u30a2\u30bf\u30c3\u30af\u3057\u3066\u304f\u308b\u5974\u306f\u3044\u308b\u3082\u306e\u3067\u3059\u3002 \u79c1\u306f\u30a2\u30bf\u30c3\u30af\u304c\u591a\u3044\u56fd\u306eIP\u3092ipta &hellip; <a href=\"https:\/\/hiro7216.mydns.jp\/blog\/?p=116\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">SSH\u3067\u306e\u30db\u30b9\u30c8\u5236\u9650<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26,287],"tags":[164],"class_list":["post-116","post","type-post","status-publish","format-standard","hentry","category-kuro-box-t4","category-nas","tag-kuro-box-t4"],"_links":{"self":[{"href":"https:\/\/hiro7216.mydns.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/116","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hiro7216.mydns.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hiro7216.mydns.jp\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hiro7216.mydns.jp\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hiro7216.mydns.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=116"}],"version-history":[{"count":0,"href":"https:\/\/hiro7216.mydns.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/116\/revisions"}],"wp:attachment":[{"href":"https:\/\/hiro7216.mydns.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=116"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hiro7216.mydns.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=116"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hiro7216.mydns.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=116"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}