{"id":994,"date":"2017-06-25T11:04:05","date_gmt":"2017-06-25T02:04:05","guid":{"rendered":"https:\/\/test.ji0vwl.net\/?p=994"},"modified":"2019-01-12T20:53:00","modified_gmt":"2019-01-12T11:53:00","slug":"%e3%83%9d%e3%83%bc%e3%83%88%e3%81%ab%e7%a9%b4%e3%82%92%e9%96%8b%e3%81%91%e3%82%8b%e3%81%93%e3%81%a8%e3%81%aa%e3%81%8f%e5%ae%89%e5%85%a8%e3%81%aa%e3%83%aa%e3%83%a2%e3%83%bc%e3%83%88%e3%83%87%e3%82%b9-2","status":"publish","type":"post","link":"https:\/\/ji0vwl.net\/index.php\/2017\/06\/25\/994\/","title":{"rendered":"\u30dd\u30fc\u30c8\u306b\u7a74\u3092\u958b\u3051\u308b\u3053\u3068\u306a\u304f\u5b89\u5168\u306a\u30ea\u30e2\u30fc\u30c8\u30c7\u30b9\u30af\u30c8\u30c3\u30d7\u74b0\u5883\u3092\u69cb\u7bc9\u3057\u3088\u3046\uff08\u305d\u306e\uff12\uff09"},"content":{"rendered":"<p><a href=\"https:\/\/test.ji0vwl.net\/index.php\/2017\/06\/24\/948\/\">\u305d\u306e\uff11<\/a>\u3067\u4f5c\u6210\u3057\u305fEC2\u4e0a\u306e\u4e2d\u7d99\u30b5\u30fc\u30d0\u306f\u4f5c\u3063\u305f\u3060\u3051\u3067\u3059\u306e\u3067\u3001\u3053\u308c\u304b\u3089\u8a2d\u5b9a\u3092\u9032\u3081\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002\u9060\u9694\u64cd\u4f5c\u5bfe\u8c61PC\u3068\u9060\u9694\u64cd\u4f5c\u3092\u3059\u308b\u5074\u306ePC\u4e21\u65b9\u5171\u306b\u8a2d\u5b9a\u304c\u5fc5\u8981\u3067\u3059\u3002\u3069\u3061\u3089\u304c\u5148\u3067\u3082\u826f\u3044\u3067\u3059\u304c\u3001\u307e\u305a\u306f\u9060\u9694\u64cd\u4f5c\u3092\u3059\u308b\u5074\u306ePC\u3067\u8a2d\u5b9a\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002\u3068\u308a\u3042\u3048\u305aMac\u3067\u306e\u8a2d\u5b9a\u4f8b\u3067\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<h4><strong>2. \u4e2d\u7d99\u30b5\u30fc\u30d0\u306bSSH\u30ed\u30b0\u30a4\u30f3\u3067\u304d\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3059\u308b\uff08Mac\u306e\u4f8b\uff09<\/strong><\/h4>\n<p>Mac\u6a19\u6e96\u306e\u30bf\u30fc\u30df\u30ca\u30eb\u3092\u7acb\u3061\u4e0a\u3052\u307e\u3059\u3002<\/p>\n<p><strong>-1. \u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305f\u79d8\u5bc6\u9375\uff08aws-key.pem\uff09\u3092.ssh\u30d5\u30a9\u30eb\u30c0\u306b\u30b3\u30d4\u30fc<\/strong><\/p>\n<pre>$ cp ~\/Downloads\/aws-key.pem ~\/.ssh\r\n<\/pre>\n<p><strong>-2. aws-key.pem\u306e\u30a2\u30af\u30bb\u30b9\u6a29\u3092400 \u306b\u5909\u66f4<\/strong><\/p>\n<pre>$ cd ~\/.ssh\r\n$ chmod 400 aws-key.pem\r\n<\/pre>\n<p><strong>-3. config\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\uff08\u4fee\u6b63\uff09<\/strong><br \/>\n.ssh\u30d5\u30a9\u30eb\u30c0\u306bconfig\u30d5\u30a1\u30a4\u30eb\u304c\u3042\u308b\u5834\u5408\u306f\u65b0\u898f\u3067\u4f5c\u6210\u3057\u3001\u3059\u3067\u306b\u3042\u308b\u5834\u5408\u306f\u3001\u4e00\u756a\u4e0b\u306e\u884c\u306b\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre>$ vi config\r\n<\/pre>\n<p>i\u3092\u62bc\u3057\u3066\u633f\u5165\u30e2\u30fc\u30c9\u306b\u3057\u3066\u3001\u4ee5\u4e0b\u306e\u9805\u76ee\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<pre>Host aws-relay-server\r\n    HostName        13.113.212.xxx  \uff08\u203b Elastic IP\u3067\u5272\u308a\u5f53\u3066\u3092\u3057\u305f\u56fa\u5b9aIP\uff09\r\n    Port            22\r\n    IdentityFile    ~\/.ssh\/aws-key.pem\r\n    User            ec2-user\r\n    Protocol        2\r\n    ServerAliveInterval 15\r\n<\/pre>\n<p>ESC\u3092\u62bc\u3057\u3066\u3001:wq\u3067\u4fdd\u5b58\u3057\u307e\u3059\u3002<br \/>\n\u3053\u308c\u3067\u4e2d\u7d99\u30b5\u30fc\u30d0\u306bSSH\u30ed\u30b0\u30a4\u30f3\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p><strong>-4. \u4e2d\u7d99\u30b5\u30fc\u30d0\u306bSSH\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u307f\u308b<\/strong><\/p>\n<pre>$ ssh aws-relay-server\r\n<\/pre>\n<pre>The authenticity of host '13.113.212.xxx (13.113.212.xxx)' can't be established.\r\nECDSA key fingerprint is SHA256:U\/7mSq0snVUviUrozSGydTX63FkmtCGEsxxxxxxxxxx.\r\nAre you sure you want to continue connecting (yes\/no)? \r\n<\/pre>\n<p>yes\u3092\u5165\u529b<\/p>\n<pre>Warning: Permanently added '13.113.212.xxx' (ECDSA) to the list of known hosts.\r\n\r\n       __|  __|_  )\r\n       _|  (     \/   Amazon Linux AMI\r\n      ___|\\___|___|\r\n\r\nhttps:\/\/aws.amazon.com\/amazon-linux-ami\/2017.03-release-notes\/\r\n4 package(s) needed for security, out of 6 available\r\nRun \"sudo yum update\" to apply all updates.\r\n<\/pre>\n<p>\u7121\u4e8b\u306b\u30ed\u30b0\u30a4\u30f3\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n<p><strong>-5. \u30b5\u30fc\u30d0\u306b\u6700\u65b0\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u9069\u7528\u3059\u308b<\/strong><br \/>\n\u30ed\u30b0\u30a4\u30f3\u5f8c\u306e\u30b3\u30e1\u30f3\u30c8\u306b\u51fa\u3066\u3044\u308b\u3088\u3046\u306b\u3001yum update\u3092\u5b9f\u884c\u3057\u3066\u6700\u65b0\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u9069\u7528\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre>$ sudo yum update -y\r\n<\/pre>\n<p>1\u5206\u304f\u3089\u3044\u304b\u304b\u304b\u308a\u307e\u3059\u304c\u3001\u6700\u5f8c\u306bComplete!\u304c\u51fa\u308c\u3070\u9069\u7528\u6210\u529f\u3067\u3059\u3002<\/p>\n<p><strong>-6. SSH\u306e\u30dd\u30fc\u30c8\u756a\u53f7\u309222\u304b\u308980\u306b\u5909\u66f4\u3059\u308b<\/strong><br \/>\n\u9060\u9694\u64cd\u4f5c\u5bfe\u8c61\u30d1\u30bd\u30b3\u30f3\u304c\u7f6e\u3044\u3066\u3042\u308b\u3068\u3053\u308d\u306e\u30eb\u30fc\u30bf\u3084\u30d5\u30a1\u30a4\u30a2\u30d5\u30a9\u30fc\u30eb\u8a2d\u5b9a\u304c\u53b3\u3057\u3044\u5834\u5408\u3001\u5916\u5411\u304d\u306e\u30dd\u30fc\u30c8\u304c\u5236\u9650\u3055\u308c\u3066\u3044\u3066SSH\u30ed\u30b0\u30a4\u30f3\u304c\u3067\u304d\u306a\u3044\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002\u5927\u62b5\u306e\u30eb\u30fc\u30bf\u3084\u30d5\u30a1\u30a4\u30a2\u30a6\u30a9\u30fc\u30eb\u306fHTTP\uff08TCP:80\u756a\uff09\u3084HTTPS\uff08TCP:443\u756a\uff09\u304c\u958b\u3044\u3066\u3044\u308b\u305f\u3081\u3001SSH\u30c8\u30f3\u30cd\u30eb\u3092\u5f35\u308b\u305f\u3081\u3060\u3051\u306b\u30eb\u30fc\u30bf\u3084\u30d5\u30a1\u30a4\u30a2\u30d5\u30a9\u30fc\u30eb\u8a2d\u5b9a\u3092\u5909\u3048\u306a\u304f\u3066\u3082\u826f\u3044\u3088\u3046\u306b\u30dd\u30fc\u30c8\u756a\u53f7\u3092\u5909\u3048\u3066\u307f\u307e\u3059\u3002<\/p>\n<pre>$ sudo -i\r\n# cd \/etc\/ssh\/\r\n# cp sshd_config sshd_config_old\r\n# vi sshd_config\r\n<\/pre>\n<p>i\u3092\u62bc\u3057\u3066\u300117\u884c\u76ee\u304f\u3089\u3044\u306e #Port 22 \u3092\u3000#\u3092\u306f\u305a\u3057\u3066\u3001Port 80\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<pre>.\r\n.\r\n.\r\n# If you want to change the port on a SELinux system, you have to tell\r\n# SELinux about this change.\r\n# semanage port -a -t ssh_port_t -p tcp #PORTNUMBER\r\n#\r\nPort 80\r\n#AddressFamily any\r\n#ListenAddress 0.0.0.0\r\n#ListenAddress ::\r\n.\r\n.\r\n.\r\n<\/pre>\n<p>ESC\u3092\u62bc\u3057\u3066\u304b\u3089:wq\u3067\u4fdd\u5b58\u5f8c\u3001sshd\u3092\u518d\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n<pre>$ service sshd restart\r\nStopping sshd:                                             [  OK  ]\r\nStarting sshd:                                             [  OK  ]\r\n<\/pre>\n<p>\u3053\u308c\u3067sshd\u304c\u518d\u8d77\u52d5\u3055\u308c\u3001\u6b21\u56de\u306eSSH\u30ed\u30b0\u30a4\u30f3\u6642\u304b\u3089\u306f80\u756a\u30dd\u30fc\u30c8\u3067\u30ed\u30b0\u30a4\u30f3\u3059\u308b\u8a2d\u5b9a\u306b\u306a\u308a\u307e\u3057\u305f\u3002exit\u30922\u56de\u5165\u529b\u3057\u3066\u3001\u4e2d\u7d99\u30b5\u30fc\u30d0\u304b\u3089\u30ed\u30b0\u30a2\u30a6\u30c8\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre># exit\r\nlogout\r\n$ exit\r\nlogout\r\nConnection to 13.113.212.xxx closed.\r\n<\/pre>\n<p><strong>-7. config\u30d5\u30a1\u30a4\u30eb\u3092\u4fee\u6b63<\/strong><br \/>\nSSH\u30dd\u30fc\u30c8\u756a\u53f7\u309280\u756a\u306b\u5909\u66f4\u3057\u305f\u306e\u3067\u3001config\u30d5\u30a1\u30a4\u30eb\u3082\u66f8\u304d\u63db\u3048\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre>$ vi config\r\n<\/pre>\n<pre>Host aws-relay-server\r\n    HostName        13.113.212.xxx\r\n    Port            80\r\n    IdentityFile    ~\/.ssh\/aws-key.pem\r\n    User            ec2-user\r\n    Protocol        2\r\n    ServerAliveInterval 15\r\n<\/pre>\n<p><strong>-8. \u4e2d\u7d99\u30b5\u30fc\u30d0\u306b\u30ed\u30b0\u30a4\u30f3\u3067\u304d\u308b\u304b\u78ba\u8a8d<\/strong><\/p>\n<pre>$ ssh aws-relay-server\r\nLast login: Sun Jun 25 01:33:12 2017 from xxxxx.xxxx.ne.jp\r\n\r\n       __|  __|_  )\r\n       _|  (     \/   Amazon Linux AMI\r\n      ___|\\___|___|\r\n\r\nhttps:\/\/aws.amazon.com\/amazon-linux-ami\/2017.03-release-notes\/\r\n<\/pre>\n<p>\u30ed\u30b0\u30a4\u30f3\u3067\u304d\u305f\u3089SSH\u306e\u8a2d\u5b9a\u306f\u5b8c\u4e86\u3067\u3059\uff01\u78ba\u8a8d\u304c\u7d42\u308f\u3063\u305f\u3089\u30ed\u30b0\u30a2\u30a6\u30c8\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre>$ exit\r\nlogout\r\nConnection to 13.113.212.xxx closed.\r\n<\/pre>\n<p><strong>-9. aws-key.pem\u3092\u9060\u9694\u64cd\u4f5c\u5bfe\u8c61\u30d1\u30bd\u30b3\u30f3\u306b\u3082\u5165\u308c\u3066\u3001\u540c\u69d8\u306e\u8a2d\u5b9a\u3092\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/strong><br \/>\n\u30fbaws-key.pem\u306e\u30b3\u30d4\u30fc<br \/>\n\u30fbaws-key.pem\u306e\u30a2\u30af\u30bb\u30b9\u6a29\u3092400\u306b\u5909\u66f4<br \/>\n\u30fbconfig\u30d5\u30a1\u30a4\u30eb\u306b\u30ed\u30b0\u30a4\u30f3\u60c5\u5831\u3092\u8a18\u8f09<\/p>\n<p>&nbsp;<\/p>\n<p>\u4ee5\u4e0a\u3067\u9060\u9694\u64cd\u4f5c\u306e\u305f\u3081\u306e\u4e2d\u7d99\u30b5\u30fc\u30d0\u306e\u524d\u8a2d\u5b9a\u306f\u304a\u3057\u307e\u3044\u3067\u3059\u3001\u304a\u75b2\u308c\u69d8\u3067\u3057\u305f\uff01<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/test.ji0vwl.net\/index.php\/2017\/06\/25\/1036\/\">\u305d\u306e\uff13<\/a>\u3078\u7d9a\u304d\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u305d\u306e\uff11\u3067\u4f5c\u6210\u3057\u305fEC2\u4e0a\u306e\u4e2d\u7d99\u30b5\u30fc\u30d0\u306f\u4f5c\u3063\u305f\u3060\u3051\u3067\u3059\u306e\u3067\u3001\u3053\u308c\u304b\u3089\u8a2d\u5b9a\u3092\u9032\u3081\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002\u9060\u9694\u64cd\u4f5c\u5bfe\u8c61PC\u3068\u9060\u9694\u64cd\u4f5c\u3092\u3059\u308b\u5074\u306ePC\u4e21\u65b9\u5171\u306b\u8a2d\u5b9a\u304c\u5fc5\u8981\u3067\u3059\u3002\u3069\u3061\u3089\u304c\u5148\u3067\u3082\u826f\u3044\u3067\u3059\u304c\u3001\u307e\u305a\u306f\u9060\u9694\u64cd\u4f5c\u3092\u3059\u308b\u5074\u306ePC\u3067\u8a2d\u5b9a\u3057\u3066 &hellip; <a href=\"https:\/\/ji0vwl.net\/index.php\/2017\/06\/25\/994\/\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">\u30dd\u30fc\u30c8\u306b\u7a74\u3092\u958b\u3051\u308b\u3053\u3068\u306a\u304f\u5b89\u5168\u306a\u30ea\u30e2\u30fc\u30c8\u30c7\u30b9\u30af\u30c8\u30c3\u30d7\u74b0\u5883\u3092\u69cb\u7bc9\u3057\u3088\u3046\uff08\u305d\u306e\uff12\uff09<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,1],"tags":[],"class_list":["post-994","post","type-post","status-publish","format-standard","hentry","category-pc","category-server"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/ji0vwl.net\/index.php\/wp-json\/wp\/v2\/posts\/994","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ji0vwl.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ji0vwl.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ji0vwl.net\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ji0vwl.net\/index.php\/wp-json\/wp\/v2\/comments?post=994"}],"version-history":[{"count":0,"href":"https:\/\/ji0vwl.net\/index.php\/wp-json\/wp\/v2\/posts\/994\/revisions"}],"wp:attachment":[{"href":"https:\/\/ji0vwl.net\/index.php\/wp-json\/wp\/v2\/media?parent=994"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ji0vwl.net\/index.php\/wp-json\/wp\/v2\/categories?post=994"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ji0vwl.net\/index.php\/wp-json\/wp\/v2\/tags?post=994"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}