拷貝本機(jī)的id_rsa文件到服務(wù)器執(zhí)行 git clone
命令的時(shí)候出現(xiàn)以下的異常
Permissions 0644 for '/home/admin/.ssh/id_rsa' are too open.
It is recommended that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: /home/admin/.ssh/id_rsa
Enter passphrase for key '/home/admin/.ssh/id_rsa':
Permission denied (publickey).
fatal: Could not read from remote repository.
出現(xiàn)以上的錯(cuò)誤,需要將私鑰的權(quán)限降級(jí)到0600被碗,執(zhí)行以下命令即可贩据。
chmod 0600 id_rsa
參考資料:ssh-keygen 密鑰