vscode私鑰設定 vscode配置遠端免密

2021-10-19 23:17:03 字數 938 閱讀 3939

通常我們為了讀寫**方便,會在ide裡檢視和修改**,每次通過remote ssh登入,頻繁的都要輸入密碼,這個很煩,索性免密登入,以後就可以想連遠端即可實現。

廢話少說,直接上教程。

1.在git bash中配置公私鑰

開啟git bash

# 輸入

ssh-keygen -t rsa -b "你想輸入的內容,可免"

# 防止忘記,建議一路回車

# 預設 金鑰id_rsa和公鑰id_rsa.pub檔案都預設儲存在(c:\user\使用者/.ssh)資料夾下)

2.將公鑰scp到遠端server的遠端使用者目錄下

舉個例子,我遠端的是192.168.255.130 root使用者,可以在/root/.ssh/下,

scp id_rsa.pub [email protected]:/root/.ssh/

# 將公鑰內容寫入檔案中

cat id_rsa.pub >> authorized_keys

# 許可權

chmod 600 authorized_keys

# 遠端server的配置即修改好了

3.在vscode中配置host user

實際上我們在連線遠端時,有時會先連線,然後再配置遠端秘鑰。

如下圖配置:

接著連線遠端server:

到這裡,就可以盡情享受免密遠端了,vscode真的太讚了,就是檢視時感覺沒有jetbrain好用。

vscode設定同步

1 settings sync是vscode中同步設定和安裝外掛程式的小工具,在擴充套件商店中搜尋並安裝它 2 登陸github your profile settings developer settings personal access tokens generate new token,輸入...

vscode 設定問題

pycharm編輯tensorflow和tensorrt出錯,importerror libcublas.so.10.0 cannot open shared object file no such file or directory 各種方法解決不了。pyjuter用不習慣,只能用vscode。只...

VSCode除錯設定

tasks.json vscodetutorial.unittest vscodetutorial.unittest.csproj istestcommand true,設定為單元測試專案 problemmatcher mscompile tasks.json檔案是專案任務的配置檔案,可在launc...