密钥使用新建的FP2.pem, 还未修改访问权限,稍后说明:
安全组使用的一个全开安全组
ssh -i "D:\A\AWS\FP2.pem" ubuntu@35.87.142.109
[22:14:17.584] Log Level: 2
[22:14:17.595] SSH Resolver called for "ssh-remote+35.87.142.109", attempt 1
[22:14:17.595] "remote.SSH.useLocalServer": false
[22:14:17.595] "remote.SSH.useExecServer": true
[22:14:17.595] "remote.SSH.showLoginTerminal": false
[22:14:17.596] "remote.SSH.remotePlatform": {"default":"linux","localhost":"linux","54.242.9.178":"linux","34.207.116.162":"linux","34.224.166.75":"linux","3.93.181.26":"linux","18.212.203.202":"linux","3.239.189.245":"linux","54.86.207.1":"linux","44.204.130.154":"linux","3.235.13.252":"linux","100.27.37.216":"linux","44.200.204.44":"linux","35.175.116.0":"linux","44.198.192.38":"linux","98.81.106.5":"linux","3.228.13.151":"linux","3.238.93.216":"linux","default2":"linux","127.0.0.1":"linux","3.209.81.200":"linux","44.222.148.27":"linux"}
[22:14:17.596] "remote.SSH.path": undefined
[22:14:17.596] "remote.SSH.configFile": undefined
[22:14:17.596] "remote.SSH.useFlock": true
[22:14:17.596] "remote.SSH.lockfilesInTmp": false
[22:14:17.596] "remote.SSH.localServerDownload": auto
[22:14:17.597] "remote.SSH.remoteServerListenOnSocket": false
[22:14:17.597] "remote.SSH.showLoginTerminal": false
[22:14:17.597] "remote.SSH.defaultExtensions": []
[22:14:17.597] "remote.SSH.loglevel": 2
[22:14:17.597] "remote.SSH.enableDynamicForwarding": true
[22:14:17.597] "remote.SSH.enableRemoteCommand": false
[22:14:17.597] "remote.SSH.serverPickPortsFromRange": {}
[22:14:17.597] "remote.SSH.serverInstallPath": {}
[22:14:17.597] "remote.SSH.permitPtyAllocation": false
[22:14:17.597] "remote.SSH.preferredLocalPortRange: undefined
[22:14:17.597] "remote.SSH.useCurlAndWgetConfigurationFiles: false
[22:14:17.601] VS Code version: 1.95.3
[22:14:17.601] Remote-SSH version: remote-ssh@0.115.1
[22:14:17.601] win32 x64
[22:14:17.604] SSH Resolver called for host: 35.87.142.109
[22:14:17.604] Setting up SSH remote "35.87.142.109"
[22:14:17.611] Using commit id "f1a4fb101478ce6ec82fe9627c43efbf9e98c813" and quality "stable" for server
[22:14:17.614] Script variables:
{
"InstallExitCode.24": "AlreadyInProgress",
"InstallExitCode.25": "ServerDownloadFailed",
"InstallExitCode.26": "NoDownloaderAvailable",
"InstallExitCode.27": "UnsupportedArch",
"InstallExitCode.28": "StatusCheckFailed",
"InstallExitCode.29": "NeedInsidersArch",
"InstallExitCode.30": "NoDownloaderAvailableForStatusCheck",
"InstallExitCode.31": "ServerTransferFailed",
"InstallExitCode.32": "ServerFailedToStart",
"InstallExitCode.33": "NeedInsidersWindows",
"InstallExitCode.34": "CreateInstallDirFailed",
"InstallExitCode.35": "UnsupportedPlatform",
"InstallExitCode.36": "ServerTerminatedCVE20201416",
"InstallExitCode.37": "UnpackFailed",
"InstallExitCode.38": "ChangeDirFailed",
"InstallExitCode.AlreadyInProgress": "24",
"InstallExitCode.ServerDownloadFailed": "25",
"InstallExitCode.NoDownloaderAvailable": "26",
"InstallExitCode.NoDownloaderAvailableForStatusCheck": "30",
"InstallExitCode.UnsupportedArch": "27",
"InstallExitCode.StatusCheckFailed": "28",
"InstallExitCode.NeedInsidersArch": "29",
"InstallExitCode.ServerTransferFailed": "31",
"InstallExitCode.ServerFailedToStart": "32",
"InstallExitCode.NeedInsidersWindows": "33",
"InstallExitCode.CreateInstallDirFailed": "34",
"InstallExitCode.UnsupportedPlatform": "35",
"InstallExitCode.ServerTerminatedCVE20201416": "36",
"InstallExitCode.UnpackFailed": "37",
"InstallExitCode.ChangeDirFailed": "38",
"InstallUnpackCode.Success": "success",
"InstallUnpackCode.Error": "error",
"InstallUnpackCode.MissingFiles": "missingFiles",
"uuid": "624d190138ff",
"startMarker": "624d190138ff: running",
"commitId": "f1a4fb101478ce6ec82fe9627c43efbf9e98c813",
"quality": "stable",
"token": "aa1aa111-a1aa-11a1-aa11-1a1a11a1a11a",
"vscodeAgentFolder": "$HOME/.vscode-server",
"allowClientDownload": "1",
"forceClientDownload": "0",
"cliNameInArchive": "code",
"ignoreWgetConfigFlag": " --no-config ",
"ignoreCurlConfigFlag": " --disable ",
"wgetTriesSegment": "--tries=1",
"listenArgs": "--on-host=127.0.0.1 --on-port",
"getDownloadServerStartTrigger": "624d190138ff:trigger_server_download",
"getDownloadServerEndTrigger": "624d190138ff:trigger_server_download_end",
"getProgressDownloading": "624d190138ff%%1%%",
"getProgressInstalling": "624d190138ff%%2%%"
}
[22:14:17.617] Install and start server if needed
[22:14:18.948] Checking ssh with "C:\ProgramData\Miniconda3\ssh.exe -V"
[22:14:18.950] Got error from ssh: spawn C:\ProgramData\Miniconda3\ssh.exe ENOENT
[22:14:18.950] Checking ssh with "C:\ProgramData\Miniconda3\Library\mingw-w64\bin\ssh.exe -V"
[22:14:18.952] Got error from ssh: spawn C:\ProgramData\Miniconda3\Library\mingw-w64\bin\ssh.exe ENOENT
[22:14:18.952] Checking ssh with "C:\ProgramData\Miniconda3\Library\usr\bin\ssh.exe -V"
[22:14:18.953] Got error from ssh: spawn C:\ProgramData\Miniconda3\Library\usr\bin\ssh.exe ENOENT
[22:14:18.953] Checking ssh with "C:\ProgramData\Miniconda3\Library\bin\ssh.exe -V"
[22:14:18.953] Got error from ssh: spawn C:\ProgramData\Miniconda3\Library\bin\ssh.exe ENOENT
[22:14:18.953] Checking ssh with "C:\ProgramData\Miniconda3\Scripts\ssh.exe -V"
[22:14:18.954] Got error from ssh: spawn C:\ProgramData\Miniconda3\Scripts\ssh.exe ENOENT
[22:14:18.954] Checking ssh with "C:\Develop\Python312\Scripts\ssh.exe -V"
[22:14:18.956] Got error from ssh: spawn C:\Develop\Python312\Scripts\ssh.exe ENOENT
[22:14:18.956] Checking ssh with "C:\Develop\Python312\ssh.exe -V"
[22:14:18.957] Got error from ssh: spawn C:\Develop\Python312\ssh.exe ENOENT
[22:14:18.957] Checking ssh with "C:\Program Files\Common Files\Oracle\Java\javapath\ssh.exe -V"
[22:14:18.958] Got error from ssh: spawn C:\Program Files\Common Files\Oracle\Java\javapath\ssh.exe ENOENT
[22:14:18.958] Checking ssh with "C:\Windows\system32\ssh.exe -V"
[22:14:18.958] Got error from ssh: spawn C:\Windows\system32\ssh.exe ENOENT
[22:14:18.959] Checking ssh with "C:\Windows\ssh.exe -V"
[22:14:18.959] Got error from ssh: spawn C:\Windows\ssh.exe ENOENT
[22:14:18.959] Checking ssh with "C:\Windows\System32\Wbem\ssh.exe -V"
[22:14:18.960] Got error from ssh: spawn C:\Windows\System32\Wbem\ssh.exe ENOENT
[22:14:18.960] Checking ssh with "C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe -V"
[22:14:18.961] Got error from ssh: spawn C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe ENOENT
[22:14:18.961] Checking ssh with "C:\Windows\System32\OpenSSH\ssh.exe -V"
[22:14:19.305] > OpenSSH_for_Windows_9.5p1, LibreSSL 3.8.2
[22:14:19.311] Running script with connection command: "C:\Windows\System32\OpenSSH\ssh.exe" -T -D 51577 "35.87.142.109" sh
[22:14:19.312] Generated SSH command: 'type "C:\Users\Eric1\AppData\Local\Temp\vscode-linux-multi-line-command-35.87.142.109-543228329.sh" | "C:\Windows\System32\OpenSSH\ssh.exe" -T -D 51577 "35.87.142.109" sh'
[22:14:19.313] Using connect timeout of 17 seconds
[22:14:19.313] Terminal shell path: C:\Windows\System32\cmd.exe
[22:14:20.636] > The authenticity of host '35.87.142.109 (35.87.142.109)' can't be established.
> ED25519 key fingerprint is SHA256:4+23skEjpGniMqTgl5hc2uglysIzRDFLgfo1xysO6Cc.
> This key is not known by any other names.
> Are you sure you want to continue connecting (yes/no/[fingerprint])?]0;C:\Windows\System32\cmd.exe
[22:14:20.636] Got some output, clearing connection timeout
[22:14:20.637] Detected fingerprint confirmation message
[22:14:20.637] Showing fingerprint confirmation dialog
[22:14:21.850] Got fingerprint response: yes
[22:14:21.850] "install" wrote data to terminal: "yes"
[22:14:21.889] > yes
> Warning: Permanently added '35.87.142.109' (ED25519) to the list of known hosts.
[22:14:22.569] > Bad permissions. Try removing permissions for user: NT AUTHORITY\\Authenticated Users (S-1-5-11) on file D:/A/AWS/FP2.pem.
> @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
> @ WARNING: UNPROTECTED PRIVATE KEY FILE! @
> @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
> Permissions for 'D:\\A\\AWS\\FP2.pem' are too open.
> It is required that your private key files are NOT accessible by others.
> This private key will be ignored.
> Load key "D:\\A\\AWS\\FP2.pem": bad permissions
> ubuntu@35.87.142.109: Permission denied (publickey).
> 过程试图写入的管道不存在。
[22:14:23.840] "install" terminal command done
[22:14:23.840] Install terminal quit with output: 过程试图写入的管道不存在。
[22:14:23.840] Received install output: 过程试图写入的管道不存在。
[22:14:23.841] Failed to parse remote port from server output
[22:14:23.842] Resolver error: Error:
at v.Create (c:\Users\Eric1\.vscode\extensions\ms-vscode-remote.remote-ssh-0.115.1\out\extension.js:2:493431)
at t.handleInstallOutput (c:\Users\Eric1\.vscode\extensions\ms-vscode-remote.remote-ssh-0.115.1\out\extension.js:2:490753)
at t.tryInstall (c:\Users\Eric1\.vscode\extensions\ms-vscode-remote.remote-ssh-0.115.1\out\extension.js:2:608797)
at async c:\Users\Eric1\.vscode\extensions\ms-vscode-remote.remote-ssh-0.115.1\out\extension.js:2:568008
at async t.withShowDetailsEvent (c:\Users\Eric1\.vscode\extensions\ms-vscode-remote.remote-ssh-0.115.1\out\extension.js:2:571256)
at async P (c:\Users\Eric1\.vscode\extensions\ms-vscode-remote.remote-ssh-0.115.1\out\extension.js:2:564794)
at async t.resolve (c:\Users\Eric1\.vscode\extensions\ms-vscode-remote.remote-ssh-0.115.1\out\extension.js:2:568667)
at async c:\Users\Eric1\.vscode\extensions\ms-vscode-remote.remote-ssh-0.115.1\out\extension.js:2:839059
[22:14:23.846] ------
[22:14:24.380] Opening exec server for ssh-remote+35.87.142.109
[22:14:24.397] Initizing new exec server for ssh-remote+35.87.142.109
[22:14:24.397] Using commit id "f1a4fb101478ce6ec82fe9627c43efbf9e98c813" and quality "stable" for server
[22:14:24.403] Script variables:
{
"InstallExitCode.24": "AlreadyInProgress",
"InstallExitCode.25": "ServerDownloadFailed",
"InstallExitCode.26": "NoDownloaderAvailable",
"InstallExitCode.27": "UnsupportedArch",
"InstallExitCode.28": "StatusCheckFailed",
"InstallExitCode.29": "NeedInsidersArch",
"InstallExitCode.30": "NoDownloaderAvailableForStatusCheck",
"InstallExitCode.31": "ServerTransferFailed",
"InstallExitCode.32": "ServerFailedToStart",
"InstallExitCode.33": "NeedInsidersWindows",
"InstallExitCode.34": "CreateInstallDirFailed",
"InstallExitCode.35": "UnsupportedPlatform",
"InstallExitCode.36": "ServerTerminatedCVE20201416",
"InstallExitCode.37": "UnpackFailed",
"InstallExitCode.38": "ChangeDirFailed",
"InstallExitCode.AlreadyInProgress": "24",
"InstallExitCode.ServerDownloadFailed": "25",
"InstallExitCode.NoDownloaderAvailable": "26",
"InstallExitCode.NoDownloaderAvailableForStatusCheck": "30",
"InstallExitCode.UnsupportedArch": "27",
"InstallExitCode.StatusCheckFailed": "28",
"InstallExitCode.NeedInsidersArch": "29",
"InstallExitCode.ServerTransferFailed": "31",
"InstallExitCode.ServerFailedToStart": "32",
"InstallExitCode.NeedInsidersWindows": "33",
"InstallExitCode.CreateInstallDirFailed": "34",
"InstallExitCode.UnsupportedPlatform": "35",
"InstallExitCode.ServerTerminatedCVE20201416": "36",
"InstallExitCode.UnpackFailed": "37",
"InstallExitCode.ChangeDirFailed": "38",
"InstallUnpackCode.Success": "success",
"InstallUnpackCode.Error": "error",
"InstallUnpackCode.MissingFiles": "missingFiles",
"uuid": "e03de976051b",
"startMarker": "e03de976051b: running",
"commitId": "f1a4fb101478ce6ec82fe9627c43efbf9e98c813",
"quality": "stable",
"token": "1aaa1111-1111-1a11-aa11-11a1111aaaa1",
"vscodeAgentFolder": "$HOME/.vscode-server",
"allowClientDownload": "1",
"forceClientDownload": "0",
"cliNameInArchive": "code",
"ignoreWgetConfigFlag": " --no-config ",
"ignoreCurlConfigFlag": " --disable ",
"wgetTriesSegment": "--tries=1",
"listenArgs": "--on-host=127.0.0.1 --on-port",
"getDownloadServerStartTrigger": "e03de976051b:trigger_server_download",
"getDownloadServerEndTrigger": "e03de976051b:trigger_server_download_end",
"getProgressDownloading": "e03de976051b%%1%%",
"getProgressInstalling": "e03de976051b%%2%%"
}
[22:14:24.404] Install and start server if needed
[22:14:24.420] Opening exec server for ssh-remote+35.87.142.109
[22:14:50.167] getPlatformForHost was canceled
[22:14:50.168] Exec server for ssh-remote+35.87.142.109 failed: Error: 已取消连接
[22:14:50.168] Existing exec server for ssh-remote+35.87.142.109 errored (Error: 已取消连接)
[22:14:50.168] Initizing new exec server for ssh-remote+35.87.142.109
[22:14:50.169] Using commit id "f1a4fb101478ce6ec82fe9627c43efbf9e98c813" and quality "stable" for server
[22:14:50.170] Error opening exec server for ssh-remote+35.87.142.109: Error: 已取消连接
[22:14:50.172] Script variables:
{
"InstallExitCode.24": "AlreadyInProgress",
"InstallExitCode.25": "ServerDownloadFailed",
"InstallExitCode.26": "NoDownloaderAvailable",
"InstallExitCode.27": "UnsupportedArch",
"InstallExitCode.28": "StatusCheckFailed",
"InstallExitCode.29": "NeedInsidersArch",
"InstallExitCode.30": "NoDownloaderAvailableForStatusCheck",
"InstallExitCode.31": "ServerTransferFailed",
"InstallExitCode.32": "ServerFailedToStart",
"InstallExitCode.33": "NeedInsidersWindows",
"InstallExitCode.34": "CreateInstallDirFailed",
"InstallExitCode.35": "UnsupportedPlatform",
"InstallExitCode.36": "ServerTerminatedCVE20201416",
"InstallExitCode.37": "UnpackFailed",
"InstallExitCode.38": "ChangeDirFailed",
"InstallExitCode.AlreadyInProgress": "24",
"InstallExitCode.ServerDownloadFailed": "25",
"InstallExitCode.NoDownloaderAvailable": "26",
"InstallExitCode.NoDownloaderAvailableForStatusCheck": "30",
"InstallExitCode.UnsupportedArch": "27",
"InstallExitCode.StatusCheckFailed": "28",
"InstallExitCode.NeedInsidersArch": "29",
"InstallExitCode.ServerTransferFailed": "31",
"InstallExitCode.ServerFailedToStart": "32",
"InstallExitCode.NeedInsidersWindows": "33",
"InstallExitCode.CreateInstallDirFailed": "34",
"InstallExitCode.UnsupportedPlatform": "35",
"InstallExitCode.ServerTerminatedCVE20201416": "36",
"InstallExitCode.UnpackFailed": "37",
"InstallExitCode.ChangeDirFailed": "38",
"InstallUnpackCode.Success": "success",
"InstallUnpackCode.Error": "error",
"InstallUnpackCode.MissingFiles": "missingFiles",
"uuid": "61da5c34901c",
"startMarker": "61da5c34901c: running",
"commitId": "f1a4fb101478ce6ec82fe9627c43efbf9e98c813",
"quality": "stable",
"token": "11a1a111-aaa1-1111-aa11-111a1aaaa1a1",
"vscodeAgentFolder": "$HOME/.vscode-server",
"allowClientDownload": "1",
"forceClientDownload": "0",
"cliNameInArchive": "code",
"ignoreWgetConfigFlag": " --no-config ",
"ignoreCurlConfigFlag": " --disable ",
"wgetTriesSegment": "--tries=1",
"listenArgs": "--on-host=127.0.0.1 --on-port",
"getDownloadServerStartTrigger": "61da5c34901c:trigger_server_download",
"getDownloadServerEndTrigger": "61da5c34901c:trigger_server_download_end",
"getProgressDownloading": "61da5c34901c%%1%%",
"getProgressInstalling": "61da5c34901c%%2%%"
}
[22:14:50.173] Install and start server if needed
看起来你的连接问题是由于私钥文件 FP2.pem
的权限设置过于宽松导致的错误。具体错误信息显示:
Permissions for 'D:\\A\\AWS\\FP2.pem' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
这个问题通常是由于文件的权限设置不当,导致 SSH 客户端拒绝使用该私钥。你可以按照以下步骤修复权限问题:
-
调整文件权限: 确保只有当前用户可以访问该文件。你可以右键点击
FP2.pem
文件,选择“属性”,然后在“安全”标签中调整文件权限。确保没有其他用户可以访问该文件。 -
使用命令行修复权限(如果是在类 Unix 系统上): 在 Linux 或 macOS 上,你可以使用以下命令来修复权限:
chmod 600 /path/to/FP2.pem
这会将文件的权限设置为仅允许文件所有者读取和写入。
-
Windows 环境: 在 Windows 上,你可以使用 PowerShell 来修改权限:
icacls "D:\A\AWS\FP2.pem" /inheritance:r /grant:r "%username%:F"
这条命令将会删除文件的继承权限,并仅允许当前用户完全访问。
在提供的命令中,%username%
是一个环境变量,它会自动替换为当前用户的用户名。在你的情况中,%username%
将被替换为 Eric1
。所以,命令会变成如下:
icacls "D:\A\AWS\FP2.pem" /inheritance:r /grant:r "Eric1:F"
这个命令的作用是:
/inheritance:r
:移除文件夹或文件的继承权限。/grant:r "Eric1:F"
:为用户Eric1
授予完全访问权限 (F表示Full Control)。
确保你以管理员身份运行命令提示符或 PowerShell,以避免权限问题。如果有任何问题,可以进一步调整命令。
(base) PS C:\Users\Eric1> icacls "D:\A\AWS\FP2.pem" /inheritance:r /grant:r "Eric1:F"
已处理的文件: D:\A\AWS\FP2.pem
已成功处理 1 个文件; 处理 0 个文件时失败
(base) PS C:\Users\Eric1>
OK 了!