{"id":1763,"date":"2013-11-01T09:00:28","date_gmt":"2013-11-01T00:00:28","guid":{"rendered":"https:\/\/www.united-bears.co.jp\/blog\/?p=1763"},"modified":"2013-11-01T09:08:37","modified_gmt":"2013-11-01T00:08:37","slug":"%e3%83%91%e3%83%83%e3%82%b1%e3%83%bc%e3%82%b8%e3%82%a2%e3%83%97%e3%83%aa%e3%82%b1%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e3%81%ae%e6%95%b4%e7%90%86","status":"publish","type":"post","link":"https:\/\/www.united-bears.co.jp\/blog\/archives\/1763","title":{"rendered":"\u30d1\u30c3\u30b1\u30fc\u30b8(\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3)\u306e\u6574\u7406"},"content":{"rendered":"<p><a href=\" https:\/\/www.united-bears.co.jp\/blog\/archives\/1731\" target=\"_blank\">\u524d\u56de<\/a>\u307e\u3067\u306e\u8a2d\u5b9a\u3067\u3001\u7ba1\u7406\u7528\u306e\u7aef\u672b\u304b\u3089 SSH \u3067\u5b89\u5168\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u72b6\u614b\u306b\u306a\u308a\u3001\u4e0d\u8981\u306a\u30a2\u30af\u30bb\u30b9\u306f iptables\/ip6tables \u3067\u62d2\u5426\u3059\u308b\u3088\u3046\u306b\u3057\u305f\u3002\u3057\u304b\u3057\u3001\u4e0d\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8(\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3)\u3092\u542b\u3093\u3067\u3044\u305f\u308a\u3001\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3055\u308c\u3066\u3044\u306a\u304b\u3063\u305f\u308a\u3059\u308b\u3068\u3001\u30b5\u30fc\u30d0\u30fc\u306f\u30bb\u30ad\u30e5\u30a2\u3068\u306f\u3044\u3048\u306a\u3044\u3002\u4eca\u56de\u306f\u3001\u30d1\u30c3\u30b1\u30fc\u30b8(\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3)\u306e\u6574\u7406\u3092\u884c\u3046\u3002<\/p>\n<p>\u4f5c\u696d\u306f\u3059\u3079\u3066su \u3067 root \u306b\u306a\u3063\u3066\u5b9f\u65bd\u3057\u3066\u3044\u308b\u3002<\/p>\n<p><strong>\u5bfe\u8c61<\/strong><br \/>\n\u5185\u90e8\u7528\u30b5\u30fc\u30d0\u30fc<br \/>\n\u5916\u90e8\u7528\u30b5\u30fc\u30d0\u30fc<br \/>\n<strong>OS<\/strong><br \/>\nCentOS release 5.10<\/p>\n<h2>\u4e0d\u8981\u306a\u30b5\u30fc\u30d3\u30b9\u306e\u505c\u6b62\u30fb\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u524a\u9664<\/h2>\n<p>\u901a\u5e38\u306f\u6700\u521d\u306b\u884c\u3046\u4f5c\u696d\u3060\u304c\u3001VPS \u306f root \u3067\u30ed\u30b0\u30a4\u30f3\u3067\u304d\u308b\u72b6\u614b\u3067\u63d0\u4f9b\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u6700\u521d\u306b SSH \u3068 iptables\/ip6tables \u306e\u8a2d\u5b9a\u3092\u884c\u3063\u305f\u3002\u4e0d\u8981\u306a\u30b5\u30fc\u30d3\u30b9\u306e\u505c\u6b62\u30fb\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u524a\u9664\u3092\u884c\u304a\u3046\u3068\u601d\u3063\u305f\u306e\u306f\u3001\u4e3b\u306b<a href=\"http:\/\/ja.wikipedia.org\/wiki\/%E3%82%A8%E3%82%AF%E3%82%B9%E3%83%97%E3%83%AD%E3%82%A4%E3%83%88\" target=\"_blank\">\u6a29\u9650\u6607\u683c\u653b\u6483(\u5206\u985e\u3092\u53c2\u7167)<\/a>\u3092\u9632\u304e\u305f\u304b\u3063\u305f\u304b\u3089\u3060\u3002<\/p>\n<p>\u3055\u304f\u3089\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u306e VPS \u306e\u5834\u5408\u3001\u4e0d\u8981\u306a\u30b5\u30fc\u30d3\u30b9\u3084\u30d1\u30c3\u30b1\u30fc\u30b8\u306f\u306a\u304b\u3063\u305f\u306e\u3067\u3001\u5b9f\u969b\u306b\u306f\u8abf\u67fb\u3060\u3051\u3092\u884c\u3063\u305f\u3002\u8abf\u67fb\u306e\u904e\u7a0b\u3092\u8a18\u9332\u3068\u3057\u3066\u6b8b\u3057\u3001\u505c\u6b62\u3084\u524a\u9664\u3092\u884c\u3046\u65b9\u6cd5\u3092\u8a18\u8ff0\u3059\u308b\u3002<\/p>\n<h3>\u4e0d\u8981\u306a\u30b5\u30fc\u30d3\u30b9\u306e\u505c\u6b62<\/h3>\n<p>\u4e0d\u8981\u306a\u30b5\u30fc\u30d3\u30b9\u3092\u6d17\u3044\u51fa\u3059\u305f\u3081\u306b\u3001chkconfig \u3084 netstat \u3092\u5229\u7528\u3057\u305f\u3002<\/p>\n<h4>netstat<\/h4>\n<p>netstat \u306f\u3001\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u63a5\u7d9a\u3084\u3001\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u30c6\u30fc\u30d6\u30eb\u3001\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306e\u8868\u793a\u3092\u884c\u3046\u305f\u3081\u306e\u30c4\u30fc\u30eb\u3060\u3002\u4eca\u56de\u306f\u3001\u901a\u4fe1\u3067\u5f85\u3061\u53d7\u3051\u3092\u884c\u3046\u30b5\u30fc\u30d3\u30b9\u3092\u8abf\u3079\u308b\u305f\u3081\u306b\u300c-l\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u3063\u305f\u3002\u300c-n\u300d\u306f\u3001\u30a2\u30c9\u30ec\u30b9\u3084\u30dd\u30fc\u30c8\u756a\u53f7\u3092\u6570\u5024\u3067\u8868\u793a\u3059\u308b\u305f\u3081\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3001\u300c-p\u300d\u306f\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u540d\u524d\u3068 PID \u3092\u8868\u793a\u3059\u308b\u305f\u3081\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3060\u3002\u300c-p\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u3001root \u6a29\u9650\u304c\u5fc5\u8981\u306b\u306a\u308b\u3002<\/p>\n<pre>\r\n[root@server ~]# netstat -lnp\r\nActive Internet connections (only servers)\r\nProto Recv-Q Send-Q Local Address  Foreign Address State  PID\/Program name\r\ntcp        0      0 0.0.0.0:[port] 0.0.0.0:*       LISTEN 1676\/sshd\r\ntcp        0      0 :::[port]      :::*            LISTEN 1676\/sshd\r\nudp        0      0 [ip]:123       0.0.0.0:*              1687\/ntpd\r\nudp        0      0 127.0.0.1:123  0.0.0.0:*              1687\/ntpd\r\nudp        0      0 0.0.0.0:123    0.0.0.0:*              1687\/ntpd\r\nudp        0      0 ::1:123        :::*                   1687\/ntpd\r\nudp        0      0 [ipv6]:123     :::*                   1687\/ntpd\r\nudp        0      0 :::123         :::*                   1687\/ntpd\r\nActive UNIX domain sockets (only servers)\r\nProto RefCnt Flags Type State I-Node PID\/Program name Path\r\n...\r\n<\/pre>\n<p>[port] \u3068\u8a18\u8ff0\u3057\u3066\u3044\u308b\u7b87\u6240\u306f\u3001sshd \u306e\u5f85\u3061\u53d7\u3051\u30dd\u30fc\u30c8\u3060\u3002\u300c123\u300d\u306f\u3001ntpd \u304c\u5f85\u3061\u53d7\u3051\u3092\u884c\u3063\u3066\u3044\u308b\u3002ntpd \u306f\u6642\u9593\u3092\u5408\u308f\u305b\u308b\u305f\u3081\u306e\u30c7\u30fc\u30e2\u30f3\u306a\u306e\u3067\u3001\u52d5\u4f5c\u3055\u305b\u3066\u3044\u308b\u3002\u4eca\u56de\u306e\u74b0\u5883\u3067\u306f\u4e0d\u8981\u306a\u30b5\u30fc\u30d3\u30b9\u306f\u5b58\u5728\u3057\u306a\u304b\u3063\u305f\u304c\u3001\u610f\u56f3\u3057\u3066\u3044\u306a\u3044\u30b5\u30fc\u30d3\u30b9\u306e\u5f85\u3061\u53d7\u3051\u304c\u3042\u308b\u5834\u5408\u306f\u3001chkconfig \u3067\u505c\u6b62\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002<\/p>\n<h4>chkconfig<\/h4>\n<p>chkconfig \u306f\u3001\u30b7\u30b9\u30c6\u30e0\u30b5\u30fc\u30d3\u30b9\u306e\u60c5\u5831\u3092\u8868\u793a\u3057\u305f\u308a\u66f4\u65b0\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3060\u3002\u8868\u793a\u306f\u3001\u300c&#8211;list\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u3064\u3051\u3066\u5b9f\u884c\u3059\u308b\u30020\uff5e6\u306e\u6570\u5b57\u306f\u3001UNIX \u306e<a href=\"http:\/\/ja.wikipedia.org\/wiki\/%E3%83%A9%E3%83%B3%E3%83%AC%E3%83%99%E3%83%AB\" target=\"_blank\">\u30e9\u30f3\u30ec\u30d9\u30eb<\/a>\u3092\u793a\u3059\u3002<\/p>\n<pre>\r\n[root@server ~]# chkconfig --list\r\nNetworkManager  0:off   1:off   2:off   3:off   4:off   5:off   6:off\r\nacpid           0:off   1:off   2:on    3:on    4:on    5:on    6:off\r\nanacron         0:off   1:off   2:off   3:off   4:off   5:off   6:off\r\natd             0:off   1:off   2:off   3:on    4:on    5:on    6:off\r\n...\r\n<\/pre>\n<p>\u4eca\u56de\u306f\u4e0d\u8981\u306a\u30b5\u30fc\u30d3\u30b9\u304c\u898b\u3064\u304b\u3089\u306a\u304b\u3063\u305f\u304c\u3001\u4e0d\u8981\u306a\u30b5\u30fc\u30d3\u30b9\u304c\u3042\u308c\u3070 chkconfig \u306b\u30b5\u30fc\u30d3\u30b9\u540d\u3068\u300coff\u300d\u3068\u3044\u3046\u5f15\u6570\u3092\u6e21\u3057\u3066\u5b9f\u884c\u3059\u308b\u3002\u554f\u984c\u306a\u304f\u8a2d\u5b9a\u3067\u304d\u305f\u5834\u5408\u3001\u5b9f\u884c\u7d50\u679c\u306f\u7279\u306b\u8868\u793a\u3055\u308c\u306a\u3044\u3002<\/p>\n<pre>\r\n[root@server ~]# chkconfig NetworkManager off\r\n<\/pre>\n<h3>\u4e0d\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u524a\u9664<\/h3>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u78ba\u8a8d\u3059\u308b\u306b\u306f\u3001rpm \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u3046\u3002\u300c-q\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u691c\u7d22\u3059\u308b\u3053\u3068\u3092\u610f\u5473\u3057\u3001\u300c-a\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u3059\u3079\u3066\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u5bfe\u8c61\u306b\u3059\u308b\u3053\u3068\u3092\u610f\u5473\u3059\u308b\u3002\u975e\u5e38\u306b\u9577\u3044\u30ea\u30b9\u30c8\u306a\u306e\u3067\u3001\u30d5\u30a1\u30a4\u30eb\u306b\u4fdd\u5b58\u3057\u305f\u3002<\/p>\n<pre>\r\n[root@server ~]# rpm -qa > packages.txt\r\n<\/pre>\n<p>\u4e0d\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u524a\u9664\u3059\u308b\u65b9\u6cd5\u306f\u3001yum \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u3046\u65b9\u6cd5\u3068\u3001rpm \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u3046\u65b9\u6cd5\u304c\u3042\u308b\u3002<br \/>\nyum \u30b3\u30de\u30f3\u30c9\u306e\u5834\u5408\u3001\u5f15\u6570\u306b remove \u3068\u30d1\u30c3\u30b1\u30fc\u30b8\u540d\u3092\u6e21\u3059\u3002\u6ce8\u610f\u304c\u5fc5\u8981\u306a\u306e\u306f\u3001\u4f9d\u5b58\u3059\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u3082\u524a\u9664\u3057\u3066\u3057\u307e\u3046\u3053\u3068\u3002\u3064\u307e\u308a\u3001\u30d1\u30c3\u30b1\u30fc\u30b8\u300c\u7fa4\u300d\u3092\u524a\u9664\u3059\u308b\u3053\u3068\u306b\u306a\u308b\u3002<br \/>\nrpm \u30b3\u30de\u30f3\u30c9\u306e\u5834\u5408\u306f\u300c-e\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u3068\u30d1\u30c3\u30b1\u30fc\u30b8\u540d\u3092\u6307\u5b9a\u3059\u308b\u3002yum \u30b3\u30de\u30f3\u30c9\u3068\u7570\u306a\u308a\u3001\u6307\u5b9a\u3057\u305f\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u307f\u524a\u9664\u3059\u308b\u3002\u307e\u305f\u3001\u524a\u9664\u3057\u3088\u3046\u3068\u3057\u3066\u3044\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u3001\u4ed6\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u4f9d\u5b58\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u3001\u52d5\u4f5c\u3092\u5f37\u5236\u3059\u308b\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u3064\u3051\u306a\u3044\u9650\u308a\u524a\u9664\u3067\u304d\u306a\u3044\u3002<\/p>\n<p>\u4eca\u56de\u306f\u3001\u4e0d\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u306f\u7279\u306b\u306a\u304b\u3063\u305f\u306e\u3067\u524a\u9664\u3057\u306a\u304b\u3063\u305f\u3002<\/p>\n<pre>\r\n[root@server ~]# rpm -e nmap\r\n<\/pre>\n<h2>\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u66f4\u65b0<\/h2>\n<p>\u4e0d\u8981\u306a\u30b5\u30fc\u30d3\u30b9\u3084\u30d1\u30c3\u30b1\u30fc\u30b8\u306f\u306a\u3044\u3053\u3068\u304c\u308f\u304b\u3063\u305f\u306e\u3067\u3001\u6700\u5f8c\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3044\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u66f4\u65b0\u3057\u3066\u518d\u8d77\u52d5\u3057\u305f\u3002<\/p>\n<pre>\r\n[root@server ~]# yum update\r\n...\r\n[root@server ~]# reboot\r\n<\/pre>\n<p>\u3053\u3053\u307e\u3067\u306e\u8a2d\u5b9a\u3067\u3001\u3068\u308a\u3042\u3048\u305a\u30b5\u30fc\u30d0\u30fc\u306f\u30bb\u30ad\u30e5\u30a2\u306a\u72b6\u614b\u306b\u306a\u3063\u305f\u306e\u3067\u306f\u306a\u3044\u3060\u308d\u3046\u304b\u3002\u6b21\u56de\u306f\u3001\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3092\u81ea\u52d5\u5316\u3092\u884c\u3063\u3066\u521d\u671f\u8a2d\u5b9a\u3092\u7d42\u3048\u308b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u56de\u307e\u3067\u306e\u8a2d\u5b9a\u3067\u3001\u7ba1\u7406\u7528\u306e\u7aef\u672b\u304b\u3089 SSH \u3067\u5b89\u5168\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u72b6\u614b\u306b\u306a\u308a\u3001\u4e0d\u8981\u306a\u30a2\u30af\u30bb\u30b9\u306f iptables\/ip6tables \u3067\u62d2\u5426\u3059\u308b\u3088\u3046\u306b\u3057\u305f\u3002\u3057\u304b\u3057\u3001\u4e0d\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8(\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3)\u3092\u542b\u3093\u3067\u3044\u305f\u308a\u3001\u30a2\u30c3 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15,30,28],"tags":[],"class_list":["post-1763","post","type-post","status-publish","format-standard","hentry","category-server","category-public_server_default","category-public_server"],"_links":{"self":[{"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/posts\/1763","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/comments?post=1763"}],"version-history":[{"count":9,"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/posts\/1763\/revisions"}],"predecessor-version":[{"id":1776,"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/posts\/1763\/revisions\/1776"}],"wp:attachment":[{"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/media?parent=1763"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/categories?post=1763"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/tags?post=1763"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}