esc阿里云免密登錄挖坑-vscode deploy插件

阿里云免密登錄實操

# 生成公鑰

# 改成加一個 pem參數(shù)
ssh-keygen -t rsa -m PEM -P ''  

xubin@xubindeMBP:~$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/xubin/.ssh/id_rsa):
/Users/xubin/.ssh/id_rsa already exists.
Overwrite (y/n)? yes
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /Users/xubin/.ssh/id_rsa.
Your public key has been saved in /Users/xubin/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:IeFPfrcQ3hhP64SRTAFzGIHl2ROcopl5HotRi2XNOGk xubin@xubindeMBP
The key's randomart image is:
+---[RSA 2048]----+
|      .o*@=o     |
|     ..oEB=o     |
|      o@=+O .    |
|      B=+o @ .   |
|       =So* *    |
|      . o. = .   |
|            o    |
|                 |
|                 |
+----[SHA256]-----+

# 查看公鑰
cat .ssh/id_rsa.pub 

# 將公鑰拷貝到服務器
scp ~/.ssh/id_rsa.pub root@47.98.252.XXX:/root

# 將公鑰加入信任列表(服務器操作)
cat id_dsa.pub >> ~/.ssh/authorized_keys

deploy插件坑

1. 報錯提示如下:解釋私鑰不能parse。

Copy Files Over SSH: Cannot parse privateKey: Unsupported key format

解決方案: 上面生產(chǎn)密鑰對的過程,要加參數(shù) --pem生成的密鑰對就可以了。
參考鏈接:https://github.com/microsoft/azure-pipelines-tasks/issues/8818

image.png

2. 當右鍵deploy上傳的時候報如下錯誤

[Error] Could not deploy file '<file>': Error: Could not get relative path for <file>

解決方案:https://github.com/mkloubert/vs-deploy/issues/135
把項目單獨的作為vscode的單項目就可以了。否則會報這個錯誤。

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯(lián)系作者
【社區(qū)內容提示】社區(qū)部分內容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發(fā)布,文章內容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

友情鏈接更多精彩內容