{"id":5265,"date":"2024-12-15T14:14:04","date_gmt":"2024-12-15T05:14:04","guid":{"rendered":"https:\/\/417.run\/?p=5265"},"modified":"2024-12-15T14:14:13","modified_gmt":"2024-12-15T05:14:13","slug":"ssh-connection","status":"publish","type":"post","link":"https:\/\/417.run\/linux\/ssh-connection\/","title":{"rendered":"vps\u306bssh\u63a5\u7d9a\u3057\u3066\u3001\u516c\u958b\u9375\u3068\u304b\u767b\u9332\u3057\u3066\u697d\u3059\u308b"},"content":{"rendered":"<p>Windows\u304b\u3089\u3001vps\u306b\u63a5\u7d9a\u3057\u3088\u3046\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u3068\u308a\u3042\u3048\u305a\u3001vps\u306bssh\u63a5\u7d9a\u3057\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-sh\">ssh vps\u306eip\u30a2\u30c9\u30ec\u30b9<\/code><\/pre>\n<p>\u516c\u958b\u9375\u3068\u304b\u767b\u9332\u3057\u3066\u306a\u3044\u3068\u30d1\u30b9\u30ef\u30fc\u30c9\u3068\u304b\u6253\u305f\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u306e\u3067\u3001<br \/>\nWindows\u5074\u3067ssh key\u3092\u4f5c\u6210\u3057\u3066\u3001\u516c\u958b\u9375\u3092vps\u306b\u5165\u308c\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<h2>SSH KEY\u306e\u4f5c\u6210(Windows\u5074)<\/h2>\n<pre><code class=\"language-sh\">cd %userprofile%\\.ssh\nssh-keygen -t rsa<\/code><\/pre>\n<p>\u6700\u521d\u306e\u5165\u529b\u306f\u3001\u30d5\u30a1\u30a4\u30eb\u540d\u3067\u3059\u3002\u7528\u9014\u3068\u304b\u306b\u3057\u3068\u304f\u3068\u3044\u3044\u3068\u601d\u3044\u307e\u3059\u3002(\u7a7a\u3067\u3082\u5927\u4e08\u592b\u3067\u3059)<br \/>\n\u6b21\u306fpassword\u3067\u3059\u304c\u79d8\u5bc6\u9375\u304c\u76d7\u307e\u308c\u306a\u3044\u4eba\u306f\u3001\u7a7a\u3067\u3044\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<h2>\u516c\u958b\u9375\u3092vps\u306b\u4fdd\u5b58\u3059\u308b<\/h2>\n<p>SSH KEY\u3092\u4f5c\u6210\u3059\u308b\u3068\u3001<br \/>\n<code>id_rea<\/code><br \/>\n<code>id_rsa.pub<\/code><br \/>\n\u306e\u4e8c\u3064\u304c\u3067\u304d\u307e\u3059\u3002id_rsa\u306e\u90e8\u5206\u306f\u81ea\u5206\u306e\u3064\u3051\u305f\u540d\u524d\u306b\u306a\u308a\u307e\u3059<br \/>\n\u62e1\u5f35\u5b50\u306a\u3057\u3001\u304c\u79d8\u5bc6\u9375\u3067.pub\u304c\u516c\u958b\u9375\u3067\u3059\u3002<\/p>\n<p>\u3053\u306e\u516c\u958b\u9375\u3092VPS\u306b\u4fdd\u5b58\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u826f\u3044\u3084\u308a\u65b9\u304c\u601d\u3044\u6d6e\u304b\u3070\u306a\u304b\u3063\u305f\u306e\u3067VSCode\u306e\u30ea\u30e2\u30fc\u30c8\u63a5\u7d9a\u3067\u3084\u3063\u3066\u3044\u3053\u3046\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u306f\u300cRemote - SSH\u300d\u62e1\u5f35\u6a5f\u80fd\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059<\/p>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u3089<br \/>\nVSCode\u4e0a\u3067<code>Ctrl<\/code>+<code>Shift<\/code>+<code>P<\/code>\u3092\u62bc\u3057\u3066<\/p>\n<pre><code>Remote-SSH: Open SSH Configuration File...<\/code><\/pre>\n<p>\u3092\u5165\u529b\u3057\u3066\u9078\u629e\u3057\u307e\u3059\u3002<br \/>\n\u305d\u3046\u3059\u308b\u3068ssh\u306econfig\u30d5\u30a1\u30a4\u30eb\u958b\u304f\u306e\u3067\u3001<\/p>\n<pre><code class=\"language-sh\">Host test-app\n    HostName 192.168.x.x\n    User root<\/code><\/pre>\n<p>\u3053\u3093\u306a\u611f\u3058\u3067\u66f8\u304d\u8fbc\u307f\u307e\u3059<\/p>\n<p>\u305d\u3046\u3059\u308b\u3068\u3053\u3093\u306a\u611f\u3058\u3067\u51fa\u3066\u304f\u308b\u306e\u3067\u3001\u63a5\u7d9a\u3059\u308c\u3070\u3001vscode\u3067\u5168\u90e8\u3044\u3058\u308c\u307e\u3059\u3002<br \/>\n<img decoding=\"async\" src=\"https:\/\/417.run\/wp-content\/uploads\/2024\/12\/image-1734239238723.png\" alt=\"file\" \/><\/p>\n<p>\u63a5\u7d9a\u3057\u305f\u3089<br \/>\n<code>\/root\/<\/code>\u306b\u5165\u3063\u3066<br \/>\n<code>.ssh<\/code>\u30d5\u30a9\u30eb\u30c0\u306e\u4e2d\u306b<code>authorized_keys<\/code>\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3066\u3001<br \/>\n\u4f5c\u6210\u3057\u305fssh\u306e.pub\u306e\u65b9\u306e\u4e2d\u8eab\u3092\u30b3\u30d4\u30da\u3057\u307e\u3059\u3002<\/p>\n<h2>SSH KEY\u3092\u6307\u5b9a\u3059\u308b<\/h2>\n<p>\u3053\u3053\u307e\u3067\u5b8c\u4e86\u3057\u305f\u3089\u3001\u3055\u3063\u304d\u306econfig\u3067<\/p>\n<pre><code class=\"language-sh\">Host test-app\n    HostName 192.168.x.x\n    User root\n    IdentityFile &quot;~\/.ssh\/id_rsa&quot;\n    IdentitiesOnly yes<\/code><\/pre>\n<p>\u3053\u3093\u306a\u611f\u3058\u3067\u3001\u79d8\u5bc6\u9375\u3092\u6307\u5b9a\u3057\u3066\u304a\u3051\u3070<br \/>\n\u30d1\u30b9\u30ef\u30fc\u30c9\u306a\u304f\u3066\u3082\u3059\u3050\u3064\u306a\u3052\u3089\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Windows\u304b\u3089\u3001vps\u306b\u63a5\u7d9a\u3057\u3088\u3046\u3068\u601d\u3044\u307e\u3059\u3002 \u3068\u308a\u3042\u3048\u305a\u3001vps\u306bssh\u63a5\u7d9a\u3057\u307e\u3059\u3002 ssh vps\u306eip\u30a2\u30c9\u30ec\u30b9 \u516c\u958b\u9375\u3068\u304b\u767b\u9332\u3057\u3066\u306a\u3044\u3068\u30d1\u30b9\u30ef\u30fc\u30c9\u3068\u304b\u6253\u305f\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u306e\u3067\u3001 Windows\u5074\u3067ssh key\u3092 &#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[83],"tags":[],"class_list":{"0":"post-5265","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-linux","7":"nothumb"},"_links":{"self":[{"href":"https:\/\/417.run\/wp-json\/wp\/v2\/posts\/5265"}],"collection":[{"href":"https:\/\/417.run\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/417.run\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/417.run\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/417.run\/wp-json\/wp\/v2\/comments?post=5265"}],"version-history":[{"count":3,"href":"https:\/\/417.run\/wp-json\/wp\/v2\/posts\/5265\/revisions"}],"predecessor-version":[{"id":5269,"href":"https:\/\/417.run\/wp-json\/wp\/v2\/posts\/5265\/revisions\/5269"}],"wp:attachment":[{"href":"https:\/\/417.run\/wp-json\/wp\/v2\/media?parent=5265"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/417.run\/wp-json\/wp\/v2\/categories?post=5265"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/417.run\/wp-json\/wp\/v2\/tags?post=5265"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}