文章出處

1.場景

由于我換了一臺電腦,為了能訪問遠程倉庫,我就把原來電腦上的私鑰和config文件拷貝過來

2.出現問題及解決方案

git clone server:xxx_service_express

報錯:

    xxxdeMacBook-Pro:php root# 
    Cloning into 'xxx_service_express'...
    Bad owner or permissions on /var/root/.ssh/config
    fatal: Could not read from remote repository.

    Please make sure you have the correct access rights
    and the repository exists.

因為我給了config 777權限,改成600就ok了(sudo chmod 600 config),繼續...

git clone server:xxx_service_express

報錯:

Cloning into 'xxx_service_express'...
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0777 for '/var/root/.ssh/id_rsa' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key "/var/root/.ssh/id_rsa": bad permissions
git@192.168.1.9's password:

很顯然沒有用到私鑰嘛,讓我輸入密碼,是給你們有一句 “Permissions 0777 for '/var/root/.ssh/id_rsa' are too open”, 私鑰是只有自己訪問的,也要改成600(sudo chmod 600 id_rsa), 繼續...

ok


文章列表


不含病毒。www.avast.com
arrow
arrow
    全站熱搜
    創作者介紹
    創作者 大師兄 的頭像
    大師兄

    IT工程師數位筆記本

    大師兄 發表在 痞客邦 留言(0) 人氣()