前提・実現したいこと
VscodeからEC2環境に接続し開発をしたい。
発生している問題・エラーメッセージ
AWSEC2にssh接続を実行する際にエラーが発生しました。
[17:03:13.167] Log Level: 2 [17:03:13.170] remote-ssh@0.55.0 [17:03:13.170] win32 x64 [17:03:13.172] SSH Resolver called for "ssh-remote+ec2-52-69-51-6.ap-northeast-1.compute.amazonaws.com", attempt 1 [17:03:13.172] SSH Resolver called for host: ec2-52-69-51-6.ap-northeast-1.compute.amazonaws.com [17:03:13.172] Setting up SSH remote "ec2-52-69-51-6.ap-northeast-1.compute.amazonaws.com" [17:03:13.192] Using commit id "d2e414d9e4239a252d1ab117bd7067f125afd80a" and quality "stable" for server [17:03:13.194] Install and start server if needed [17:03:15.732] Checking ssh with "ssh -V" [17:03:15.768] > OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5 [17:03:15.771] Remote command length: 7592/8192 characters [17:03:15.772] Using SSH config file "C:\Users\Haruki Takao.ssh\config" [17:03:15.772] Running script with connection command: ssh -T -D 52222 -F "C:\Users\Haruki Takao.ssh\config" ec2-52-69-51-6.ap-northeast-1.compute.amazonaws.com powershell -ExecutionPolicy Unrestricted -NoLogo -NoProfile -NonInteractive -Command "powershell -ExecutionPolicy Unrestricted -NoLogo -NoProfile -NonInteractive -EncodedCommand $([Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes([Text.Encoding]::UTF8.GetString([Convert]::FromBase64String('CmVjaG8gImM2OWRmN2JkM2UxMjogcnVubmluZyIKJFByb2dyZXNzUHJlZmVyZW5jZT0nU2lsZW50bHlDb250aW51ZScKJGNvbW1pdElkPSdkMmU0MTRkOWU0MjM5YTI1MmQxYWIxMTdiZDcwNjdmMTI1YWZkODBhJwokcD0kZW52OlBST0NFU1NPUl9BUkNISVRFQ1RVUkUKJGFyY2g9aWYgKCgkcCAtZXEgJ0FNRDY0JykgLW9yICgkcCAtZXEgJ0lBNjQnKSkgeyAneDY0JyB9IGVsc2UgeyAnaWEzMicgfQokc2VydmVyUm9vdD0o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fT3BlcmF0aW5nU3lzdGVtKS5WZXJzaW9uCn0gY2F0Y2ggewplY2hvICJGYWlsZWQgdG8gZmluZCBXaW5kb3dzIHZlcnNpb24gLSAkKCRfLlRvU3RyaW5nKCkpIgokd2luVmVyc2lvbj0idW5rbm93biIKfQplY2hvICJjNjlkZjdiZDNlMTI6IHN0YXJ0IgplY2hvICJzc2hBdXRoU29jaz09JGVudjpTU0hfQVVUSF9TT0NLPT0iCmVjaG8gImxpc3RlbmluZ09uPT0kcG9ydD09IgplY2hvICJvc1JlbGVhc2VJZD09d2luZG93cz09IgplY2hvICJvc1ZlcnNpb249PSR3aW5WZXJzaW9uPT0iCmVjaG8gImFyY2g9PSRhcmNoPT0iCmVjaG8gInBsYXRmb3JtPT13aW5kb3dzPT0iCmVjaG8gImM2OWRmN2JkM2UxMjogZW5kIgplY2hvICJJbnN0YWxsIHNjcmlwdCBpcyAkcGlkLCB3YXRjaGluZyBzc2hkIHBhcmVudCAkc3NoZFBJRCIKd2hpbGUgKCRUcnVlKSB7CmV4aXRJZk5lZWRlZApzbGVlcCAzMAp9Cg==')))))" # RemoteSSHConfigurationScript [17:03:15.773] Terminal shell path: C:\windows\System32\cmd.exe [17:03:15.842] > > > > > ]0;C:\windows\System32\cmd.exe [17:03:15.842] Got some output, clearing connection timeout [17:03:15.851] > > > [17:03:17.215] > bash: command substitution: line 1: syntax error near unexpected token `[Text.En > coding]::Unicode.GetBytes' > bash: command substitution: line 1: `[Convert]::ToBase64String([Text.Encoding]:: > Unicode.GetBytes([Text.Encoding]::UTF8.GetString([Convert]::FromBase64String('Cm > VjaG8gImM2OWRmN2JkM2UxMjogcnVubmluZyIKJFByb2dyZXNzUHJlZmVyZW5jZT0nU2lsZW50bHlDb2 > 50aW51ZScKJGNvbW1pdElkPSdkMmU0MTRkOWU0MjM5YTI1MmQxYWIxMTdiZDcwNjdmMTI1YWZkODBhJw > okcD0kZW52OlBST0NFU1NPUl9BUkNISVRFQ1RVUkUKJGFyY2g9aWYgKCgkcCAtZXEgJ0FNRDY0JykgLW > 9yICgkcCAtZXEgJ0lBNjQnKSkgeyAneDY0JyB9IGVsc2UgeyAnaWEzMicgfQokc2VydmVyUm9vdD0oSm > 9pbi1QYXRoIChSZXNvbHZlLVBhdGggfikgJy52c2NvZGUtc2VydmVyJykKJGVudjpWU0NPREVfQUdFTl > RfRk9MREVSPSRzZXJ2ZXJSb290CiRsb2c9IiRzZXJ2ZXJSb290XC4kY29tbWl0SWQubG9nIgokc0Rpcj > 0iJHNlcnZlclJvb3RcYmluXCRjb21taXRJZCIKJHF1YWxpdHk9J3N0YWJsZScKJHRlbGVtZXRyeT0iIg > okZXh0cz0iIgpmdW5jdGlvbiBnZXRTc2hkUGFyZW50UGlkIHsKJGN1cnJlbnRQSUQ9JFBJRAp3aGlsZS > xpdHkiClRpbWVvdXRTZWM9MjAKT3V0RmlsZT0idnNjb2RlLXNlcnZlci56aXAiClVzZUJhc2ljUGFyc2 > luZz0kVHJ1ZQp9CltOZXQuU2VydmljZVBvaW50TWFuYWdlcl06OlNlY3VyaXR5UHJvdG9jb2wgPSBbTm > V0LlNlcnZpY2VQb2ludE1hbmFnZXJdOjpTZWN1cml0eVByb3RvY29sIC1ib3IgW05ldC5TZWN1cml0eV [17:03:17.525] "install" terminal command done [17:03:17.525] Install terminal quit with output: Akc3NoZFBJRCIKd2hpbGUgKCRUcnVlKSB7CmV4aXRJZk5lZWRlZApzbGVlcCAzMAp9Cg==')))))' [17:03:17.525] Received install output: Akc3NoZFBJRCIKd2hpbGUgKCRUcnVlKSB7CmV4aXRJZk5lZWRlZApzbGVlcCAzMAp9Cg==')))))' [17:03:17.526] Stopped parsing output early. Remaining text: Akc3NoZFBJRCIKd2hpbGUgKCRUcnVlKSB7CmV4aXRJZk5lZWRlZApzbGVlcCAzMAp9Cg==')))))' [17:03:17.526] Failed to parse remote port from server output [17:03:17.538] Resolver error: Error: at Function.Create (c:\Users\Haruki Takao.vscode\extensions\ms-vscode-remote.remote-ssh-0.55.0\out\extension.js:1:130564) at Object.t.handleInstallOutput (c:\Users\Haruki Takao.vscode\extensions\ms-vscode-remote.remote-ssh-0.55.0\out\extension.js:1:127671) at I (c:\Users\Haruki Takao.vscode\extensions\ms-vscode-remote.remote-ssh-0.55.0\out\extension.js:127:106775) at processTicksAndRejections (internal/process/task_queues.js:94:5) at async c:\Users\Haruki Takao.vscode\extensions\ms-vscode-remote.remote-ssh-0.55.0\out\extension.js:127:104774 at async Object.t.withShowDetailsEvent (c:\Users\Haruki Takao.vscode\extensions\ms-vscode-remote.remote-ssh-0.55.0\out\extension.js:127:109845) at async Object.t.resolve (c:\Users\Haruki Takao.vscode\extensions\ms-vscode-remote.remote-ssh-0.55.0\out\extension.js:127:107960) at async c:\Users\Haruki Takao.vscode\extensions\ms-vscode-remote.remote-ssh-0.55.0\out\extension.js:127:141955 [17:03:17.541] ------
該当のソースコード
configファイル
Host ec2-52-69-51-6.ap-northeast-1.compute.amazonaws.com HostName 52.69.51.6 IdentityFile "C:\Users\Haruki Takao.ssh\hirameki-keypair.pem" User ec2-user
試したこと
コマンドプロンプトからのssh接続確認
Microsoft Windows [Version 10.0.18362.1139] (c) 2019 Microsoft Corporation. All rights reserved. C:\Users\Haruki Takao> ssh -i "C:\Users\Haruki Takao.ssh\hirameki-keypair.pem" ec2-user@ec2-52-69-51-6.ap-northeast-1.compute.amazonaws.com Last login: Sun Oct 25 07:54:05 2020 from kd106180013233.au-net.ne.jp Last login: Sun Oct 25 07:54:05 2020 from kd106180013233.au-net.ne.jp __| __|_ ) _| ( / Amazon Linux 2 AMI ___|\___|___| https://aws.amazon.com/amazon-linux-2/ 11 package(s) needed for security, out of 39 available Run "sudo yum update" to apply all updates. [ec2-user@ip-172-31-41-196 ~]$
補足情報(FW/ツールのバージョンなど)
エラーログから
bash: command substitution: line 1: syntax error near unexpected token `[Text.Encoding]::Unicode.GetBytes'
辺りが問題だとは思うんですが対処方法がわかりません。
先駆者の方わかる方いましたら教えてください。
回答1件
あなたの回答
tips
プレビュー