Quantcast
Channel: 可丁丹尼 @ 一路往前走2.0
Viewing all articles
Browse latest Browse all 79

ssh authorized_key 失效

$
0
0

使用 VSCode 遠端開發時發現把 public key 加入 authorized_key 還是失效,之後才知道可以加上參數進行檢查,於事先在”命令提示字元執行ssh`:

ssh -i [private key path name] -v gw@192.168.19.38

結果發現真的有問題:

:
:
debug1: Next authentication method: publickey
debug1: Offering public key: id_rsa-dmgw RSA SHA256:eXU7QTcaydeRJeEwHa9bOA9swT explicit
debug1: Server accepts key: id_rsa-dmgw RSA SHA256:eXU7QTcaydeRJeEwHa9bOA9swT explicit
Load key "id_rsa-dmgw": invalid format

最後不知道怎麼解決,直接拷貝別台機器上同樣的 private key至 windows後再進行一次檢查,檢查命令:

ssh-keygen -y -f [private key path name]

結果:

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCfeAvs gw@dmgw

如果錯誤時會出現:

Load key "id_rsa-dmgw": invalid format

The post ssh authorized_key 失效 appeared first on 可丁丹尼 @ 一路往前走2.0.


Viewing all articles
Browse latest Browse all 79

Trending Articles