
root@etoorlan4c:~/.ssh# ssh-keygen -i
Enter file in which the key is (/root/.ssh/id_rsa):
uudecode failed.
我正在嘗試獲取與 id_rsa.txt 中的私鑰相對應的公鑰。我運行上面的命令,但失敗並出現 uudecode 錯誤。該密鑰是複製並貼上的,因此它可能是正確的。我嘗試使用系統產生的密鑰ssh-keygen -t rsa
,但也返回錯誤。
root@etoorlan4c:~/.ssh# ssh-keygen -i
Enter file in which the key is (/root/.ssh/id_rsa):
decode blob failed: invalid format
請注意,第二個範例只是為了說明命令在多個上下文中失敗的情況,以防這是更大錯誤的症狀。我主要關心的是修復第一個錯誤。
答案1
/root/.ssh/id_rsa
儘管您已貼上內容,但內容無效。
刪除舊文件並重新創建
rm /root/.ssh/id_rsa*
ssh-keygen -t rsa
答案2
您看過-m
指定格式的選項嗎?除此之外,您是否從提供的密鑰中正確複製了密鑰,使用vim
和 選項查找換行符和其他奇特字元:set list
。也許複製了不可見的字元和/或發送金鑰的格式不是預設的預期格式。