VSCode Connect Host Remote-SSH的日志

2023-12-28 19:31:34

VSCode可以通过SSH连接Remote的机器,这实在是方便。这个操作是如何完成的,可以从VSCode控制台的输出孔中窥豹。

[17:14:45.247] Log Level: 2
[17:14:45.254] VS Code version: 1.85.1
[17:14:45.254] Remote-SSH version: remote-ssh@0.107.1
[17:14:45.254] darwin arm64
[17:14:45.255] SSH Resolver called for "ssh-remote+172.0.0.0", attempt 1
[17:14:45.255] "remote.SSH.useLocalServer": true
[17:14:45.255] "remote.SSH.useExecServer": false
[17:14:45.255] "remote.SSH.path": undefined
[17:14:45.255] "remote.SSH.configFile": undefined
[17:14:45.255] "remote.SSH.useFlock": true
[17:14:45.255] "remote.SSH.lockfilesInTmp": false
[17:14:45.256] "remote.SSH.localServerDownload": auto
[17:14:45.256] "remote.SSH.remoteServerListenOnSocket": false
[17:14:45.256] "remote.SSH.showLoginTerminal": false
[17:14:45.256] "remote.SSH.defaultExtensions": []
[17:14:45.256] "remote.SSH.loglevel": 2
[17:14:45.256] "remote.SSH.enableDynamicForwarding": true
[17:14:45.256] "remote.SSH.enableRemoteCommand": false
[17:14:45.256] "remote.SSH.serverPickPortsFromRange": {}
[17:14:45.257] "remote.SSH.serverInstallPath": {}
[17:14:45.260] SSH Resolver called for host: 172.0.0.0
[17:14:45.260] Setting up SSH remote "172.0.0.0"
[17:14:45.262] Acquiring local install lock: /var/folders/qp/vr0wtc990vn6yh12klvbmdym0000gp/T/vscode-remote-ssh-8c5e39cd-install.lock
[17:14:45.265] Looking for existing server data file at /Users/yangfan42/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-8c5e39cd-0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2-0.107.1-tr/data.json
[17:14:45.265] Using commit id "0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2" and quality "stable" for server
[17:14:45.269] Install and start server if needed
[17:14:45.272] PATH: /usr/bin:/bin:/usr/sbin:/sbin
[17:14:45.272] Checking ssh with "ssh -V"
[17:14:45.278] > OpenSSH_8.1p1, LibreSSL 2.7.3

[17:14:45.281] askpass server listening on /var/folders/qp/vr0wtc990vn6yh12klvbmdym0000gp/T/vscode-ssh-askpass-4cce53ca97da62f9ba7e7b8f68d560a6674a04c1.sock
[17:14:45.281] Spawning local server with {"serverId":1,"ipcHandlePath":"/var/folders/qp/vr0wtc990vn6yh12klvbmdym0000gp/T/vscode-ssh-askpass-5c88561f2bb6dd1dca064d632ef2d15115d4a8ec.sock","sshCommand":"ssh","sshArgs":["-v","-T","-D","62842","-o","ConnectTimeout=15","172.0.0.0"],"serverDataFolderName":".vscode-server","dataFilePath":"<UserHome>/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-8c5e39cd-0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2-0.107.1-tr/data.json"}
[17:14:45.281] Local server env: {"SSH_AUTH_SOCK":"/private/tmp/com.apple.launchd.CIYC0PeGhH/Listeners","SHELL":"/bin/zsh","DISPLAY":"1","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"<UserHome>/.vscode/extensions/ms-vscode-remote.remote-ssh-0.107.1/out/local-server/askpass.sh","VSCODE_SSH_ASKPASS_NODE":"/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin)","VSCODE_SSH_ASKPASS_EXTRA_ARGS":"--ms-enable-electron-run-as-node","VSCODE_SSH_ASKPASS_MAIN":"<UserHome>/.vscode/extensions/ms-vscode-remote.remote-ssh-0.107.1/out/askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"/var/folders/qp/vr0wtc990vn6yh12klvbmdym0000gp/T/vscode-ssh-askpass-4cce53ca97da62f9ba7e7b8f68d560a6674a04c1.sock"}
[17:14:45.282] Spawned 44501
[17:14:45.371] > local-server-1> Running ssh connection command: "-v -T -D 62842 -o ConnectTimeout=15 172.0.0.0"
[17:14:45.387] > local-server-1> Spawned ssh, pid=44508
[17:14:45.388] stderr> OpenSSH_8.1p1, LibreSSL 2.7.3
[17:14:45.431] stderr> debug1: Server host key: ecdsa-sha2-nistp256 SHA256:WC08QMb0q4umZnUF1zX/LQw1HaMj7v0o3pXE02T0Xys
[17:14:45.542] stderr> Authenticated to 172.0.0.0 ([172.0.0.0]:22).
[17:14:45.634] > Welcome to Ubuntu 18.04.6 LTS (GNU/Linux 5.15.133.1-microsoft-standard-WSL2 x86_64)
> 
>  * Documentation:  https://help.ubuntu.com
>  * Management:     https://landscape.canonical.com
>  * Support:        https://ubuntu.com/advantage
> This system has been minimized by removing packages and content that are
> not required on a system that users do not log into.
> 
> To restore this content, you can run the 'unminimize' command.
[17:14:45.640] > ready: 08a03382f394
[17:14:45.652] > Linux 5.15.133.1-microsoft-standard-WSL2 #1 SMP Thu Oct 5 21:02:42 UTC 2023
[17:14:45.652] Platform: linux
[17:14:45.660] > /bin/bash
[17:14:45.660] Shell: bash
[17:14:45.660] Creating bash subshell inside "bash"
[17:14:45.674] > bash version:  4.4.20(1)-release
[17:14:45.695] > 08a03382f394: running
[17:14:45.750] > Acquiring lock on /home/osuser/.vscode-server/bin/0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2/vscode-remote-lock.osuser.0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2
[17:14:45.760] > Installing to /home/osuser/.vscode-server/bin/0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2...
> 08a03382f394%%1%%
[17:14:45.770] > Downloading with wget
[17:15:07.264] > Download complete
[17:15:07.292] > 08a03382f394%%2%%
> tar --version:
> tar (GNU tar) 1.29
> Copyright (C) 2015 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
> 
> Written by John Gilmore and Jay Fenlason.
[17:15:08.193] > Checking /home/osuser/.vscode-server/.0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2.log and /home/osuser/.vscode-server/.0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2.pid for a running server
[17:15:08.200] > Running ssh connection command... /home/osuser/.vscode-server/bin/0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2/bin/code-server --start-server --host=127.0.0.1 --accept-server-license-terms --enable-remote-auto-shutdown --port=0 --telemetry-level all   &> "/home/osuser/.vscode-server/.0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2.log" < /dev/null
> printenv:
>     SSH_CONNECTION=172.0.0.1 54755 172.0.0.2 22
>     QT5_PATH=/usr/local/qt5
>     USER=osuser
>     QT_QPA_PLATFORM_PLUGIN_PATH=/usr/local/qt5/plugins
>     PWD=/home/osuser
>     HOME=/home/osuser
>     SSH_CLIENT=172.0.0.1 54755 22
>     MAIL=/var/mail/osuser
>     SHELL=/bin/bash
>     SHLVL=2
>     VSCODE_AGENT_FOLDER=/home/osuser/.vscode-server
>     LOGNAME=osuser
>     PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/local/qt5/bin
>     _=/usr/bin/printenv
>     OLDPWD=/home/osuser/.vscode-server/bin/0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2
> Spawned remote server: 2505
> Waiting for server log...
[17:15:08.200] stderr> rm: cannot remove '/home/osuser/.vscode-server/.0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2.token': No such file or directory
[17:15:08.212] > Waiting for server log...
[17:15:08.253] >  
> *
> * Visual Studio Code Server
> *
> * By using the software, you agree to
> * the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and
> * the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).
> *
>  
[17:15:08.262] > 08a03382f394: start
> SSH_AUTH_SOCK====
> DISPLAY====
> webUiAccessToken====
> listeningOn==38289==
> osReleaseId==ubuntu==
> arch==x86_64==
> vscodeArch==x64==
> bitness==64==
> tmpDir==/tmp==
> platform==linux==
> unpackResult==success==
> didLocalDownload==0==
> downloadTime==21481==
> installTime==916==
> extInstallTime====
> serverStartTime==81==
> connectionToken==1a11a111-1111-111a-1111-1111a1111111==
> 08a03382f394: end
[17:15:08.263] Received install output: 
SSH_AUTH_SOCK====
DISPLAY====
webUiAccessToken====
listeningOn==38289==
osReleaseId==ubuntu==
arch==x86_64==
vscodeArch==x64==
bitness==64==
tmpDir==/tmp==
platform==linux==
unpackResult==success==
didLocalDownload==0==
downloadTime==21481==
installTime==916==
extInstallTime====
serverStartTime==81==
connectionToken==1a11a111-1111-111a-1111-1111a1111111==

[17:15:08.263] Remote server is listening on port 38289
[17:15:08.263] Parsed server configuration: {"serverConfiguration":{"remoteListeningOn":{"port":38289},"osReleaseId":"ubuntu","arch":"x86_64","webUiAccessToken":"","sshAuthSock":"","display":"","tmpDir":"/tmp","platform":"linux","connectionToken":"1a11a111-1111-111a-1111-1111a1111111"},"downloadTime":21481,"installTime":916,"serverStartTime":81,"installUnpackCode":"success"}
[17:15:08.264] Persisting server connection details to <UserHome>/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-8c5e39cd-0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2-0.107.1-tr/data.json
[17:15:08.266] Starting forwarding server. local port 62851 -> socksPort 62842 -> remotePort 38289
[17:15:08.267] Forwarding server listening on port 62851
[17:15:08.267] Waiting for ssh tunnel to be ready
[17:15:08.268] Tunneled port 38289 to local port 62851
[17:15:08.268] Resolved "ssh-remote+172.0.0.0" to "port 62851"
[17:15:08.269] [Forwarding server port 62851] Got connection 0
[17:15:08.275] ------




[17:15:08.283] [Forwarding server port 62851] Got connection 1
[17:15:08.379] [Forwarding server port 62851] Got connection 2

文章来源:https://blog.csdn.net/gikod/article/details/135274582
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。