[Up]常用資訊

[重點文章] 重點文章 [重點文章] 重點文章

2021年3月31日 星期三

[VS_Code] windows 10 VS_Code安裝 ssh remote 排錯

[VS_Code] windows 10 VS_Code安裝 ssh remote 排錯

[VS_Code] windows 10 VS_Code安裝 ssh remote 排錯

 
#Step 01 – VS Code的错误


> 
[16:04:58.813] > getsockname failed: Not a socket
> 
[16:04:58.823] > packet_write_poll: Connection to UNKNOWN port -1: Permission denied
> 過程試圖寫入的管道不存在。
> 
[16:04:59.269] "install" terminal command done
[16:04:59.270] Install terminal quit with output: 過程試圖寫入的管道不存在。
[16:04:59.270] Received install output: 過程試圖寫入的管道不存在。
[16:04:59.271] Stopped parsing output early. Remaining text: 過程試圖寫入的管道不存在。
[16:04:59.271] Failed to parse remote port from server output
[16:04:59.271] Resolver error:

 
#Step 02 – CMD 錯誤
 
#使用ssh命令在cmd視窗下得到的錯誤是:

C:\>ssh sh
getsockname failed: Not a socket
ssh_dispatch_run_fatal: Connection to UNKNOWN port -1: incomplete message


注釋掉.ssh/config裡面的 ControlPath 就可以了

 
#範例

#
#設定檔位置 C:\Users\<帳號>\.ssh\config
#
Host 192.168.119.134
  HostName 192.168.119.134
  User root

#避免要多次輸入密碼,加入以下ControlMaster設定
Host *
    ControlMaster auto
    #ControlPath  ~/.ssh/sockets/%r@%h-%p
    ControlPersist  24h
 
#防止timeout,每120秒就向server發送keep-alive封包,超過60次無回應斷線
ServerAliveInterval 120
ServerAliveCountMax 60

Host 192.168.88.11
  HostName 192.168.88.11
  Port 22
  User root
  #IdentityFile "C:\Users\<帳號>\.ssh\authorized_keys"

Host 192.168.88.13
  HostName 192.168.88.13
  User root

沒有留言:

張貼留言