簡體   English   中英

無法使用 VS Code 連接到遠程服務器 - 遠程 SSH 擴展

[英]Cannot connect to remote server using VS Code - remote SSH extension

當我嘗試使用遠程 ssh 擴展通過 vs 代碼連接到遠程服務器 (linux) 時出現問題。

首先,當使用終端、膩子甚至 SSH FS 擴展時,我可以連接到 ssh 中的服務器。

我在服務器上的權限很小,因為是工作環境(我只能編輯我的用戶文件夾中的文件夾和文件),並且服務器無法從外部源下載,並且只打開了幾個端口。

日志(我隱藏了 ip,用戶和服務器免責聲明):

[14:36:38.747] Log Level: 2
[14:36:38.748] remote-ssh@0.76.1
[14:36:38.748] win32 x64
[14:36:38.749] SSH Resolver called for "ssh-remote+<IPSERVER>", attempt 1
[14:36:38.750] "remote.SSH.useLocalServer": false
[14:36:38.750] "remote.SSH.showLoginTerminal": false
[14:36:38.750] "remote.SSH.remotePlatform": {"<IPSERVER>":"linux","<IPSERVER>":"linux"}
[14:36:38.750] "remote.SSH.path": undefined
[14:36:38.750] "remote.SSH.configFile": C:\Users\<USER>\.ssh\config
[14:36:38.751] "remote.SSH.useFlock": true
[14:36:38.751] "remote.SSH.lockfilesInTmp": false
[14:36:38.751] "remote.SSH.localServerDownload": auto
[14:36:38.751] "remote.SSH.remoteServerListenOnSocket": false
[14:36:38.751] "remote.SSH.showLoginTerminal": false
[14:36:38.751] "remote.SSH.defaultExtensions": []
[14:36:38.751] "remote.SSH.loglevel": 2
[14:36:38.752] "remote.SSH.enableDynamicForwarding": false
[14:36:38.752] "remote.SSH.enableRemoteCommand": false
[14:36:38.752] "remote.SSH.serverPickPortsFromRange": {}
[14:36:38.752] "remote.SSH.serverInstallPath": {}
[14:36:38.757] SSH Resolver called for host: <IPSERVER>
[14:36:38.757] Setting up SSH remote "<IPSERVER>
[14:36:38.761] Using commit id "<longNumber>" and quality "stable" for server
[14:36:38.766] Install and start server if needed
[14:36:38.768] Checking ssh with "ssh -V"
[14:36:38.900] > OpenSSH_for_Win
[14:36:38.900] > dows_8.1p1, LibreSSL 3.0.2

[14:36:38.908] Using SSH config file "C:\Users\<USER>\.ssh\config"
[14:36:38.908] Running script with connection command: ssh -T -o ClearAllForwardings=true -F "C:\Users\<USER>\.ssh\config" "<IPSERVER>" bash
[14:36:38.913] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[14:36:39.265] > ]0;C:\WINDOWS\System32\cmd.exe
[14:36:39.266] Got some output, clearing connection timeout
[14:36:39.356] > #
[14:36:39.376] > #########################################################################
<SERVER DISCLAIMER>

[14:36:39.707] > 13467ee179b9: running
[14:36:39.742] > Acquiring lock on /export/home/<USER>/.vscode-server/bin/f80445acd5a3dadef24aa2
> 09168452a3d97cc326/vscode-remote-lock.<USER>.f80445acd5a3dadef24aa209168452a3d9
> 7cc326
> Found existing installation at /export/home/<USER>/.vscode-server/bin/f80445acd
> 5a3dadef24aa209168452a3d97cc326...
> Checking /export/home/<USER>/.vscode-server/.f80445acd5a3dadef24aa209168452a3d9
[14:36:39.745] > 
> 7cc326.log and /export/home/<USER>/.vscode-server/.f80445acd5a3dadef24aa2091684
> 52a3d97cc326.pid for a running server
> Looking for server with pid: 1909126
[14:36:39.756] > 
[14:36:39.772] > Found running server...
> 
> *
> * Reminder: You may only use this software with Visual Studio family products,
> * as <USER>ribed in the license (https://go.microsoft.com/fwlink/?linkid=2077057) 
> *
> 
[14:36:39.784] > 
> Checking server status on port 32829 with wget
> 13467ee179b9: start
> webUiAccessToken====
[14:36:39.793] > 
> listeningOn==32829==
> osReleaseId==rhel==
> arch==x86_64==
> tmpDir==/run/user/54414==
> platform==linux==
> unpackResult====
> didLocalDownload==0==
> downloadTime====
> installTime====
> extInstallTime====
> serverStartTime====
> connectionToken==a1a1a1a1-111a-1111-111a-111a1aa1aaa1==
> 13467ee179b9: end
[14:36:39.794] Received install output: 
webUiAccessToken====
listeningOn==32829==
osReleaseId==rhel==
arch==x86_64==
tmpDir==/run/user/54414==
platform==linux==
unpackResult====
didLocalDownload==0==
downloadTime====
installTime====
extInstallTime====
serverStartTime====
connectionToken==a1a1a1a1-111a-1111-111a-111a1aa1aaa1==

[14:36:39.794] Remote server is listening on 32829
[14:36:39.794] Parsed server configuration: {"serverConfiguration":{"remoteListeningOn":{"port":32829},"osReleaseId":"rhel","arch":"x86_64","webUiAccessToken":"","tmpDir":"/run/user/54414","platform":"linux","connectionToken":"a1a1a1a1-111a-1111-111a-111a1aa1aaa1"},"installUnpackCode":""}
[14:36:39.800] Using SSH config file "C:\Users\<USER>\.ssh\config"
[14:36:39.800] Running script with connection command: ssh -T -L 127.0.0.1:61860:127.0.0.1:32829 -F "C:\Users\<USER>\.ssh\config" "<IPSERVER>" bash
[14:36:39.802] Spawning tunnel with: type "C:\Users\<USER>\AppData\Local\Temp\vscode-linux-multi-line-command-<IPSERVER>-155647009.sh" | ssh -T -L 127.0.0.1:61860:127.0.0.1:32829 -F "C:\Users\<USER>\.ssh\config" "<IPSERVER>" bash
[14:36:39.802] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[14:36:39.803] > 
[14:36:40.038] > ]0;C:\WINDOWS\System32\cmd.exe
[14:36:40.143] > #
<SEVER DISCLAIMER>
[14:36:40.483] > Connected to SSH Host - Please do not close this terminal
[14:36:40.484] Spawned SSH tunnel between local port 61860 and remote target 32829
[14:36:40.484] Waiting for ssh tunnel to be ready
[14:36:40.490] Tunneled 32829 to local port 61860
[14:36:40.490] Resolved "ssh-remote+<IPSERVER>" to "127.0.0.1:61860"
[14:36:40.500] ------




[14:36:40.731] > channel 2: open failed: administratively prohibited: open failed
[14:36:40.783] > channel 2: open failed: administratively prohibited: open failed
> channel 2: open failed: administratively prohibited: open failed
[14:36:41.112] "install" terminal command done
[14:36:41.113] Install terminal quit with output: 

TCP 需要啟用轉發功能才能使用此功能。 除了要求管理員在/etc/ssh/sshd_config上設置AllowTcpForwarding yes之外,您無法使用此功能。開放問題 - 不要依賴 ssh TCP 端口轉發

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM