CentOS使用在有私钥时使用ssh进行git clone要求输入密码的解决方案

i’m a CentOS user using Fedora 23
There exists some question when

  $ git clone git clone metastasis@shtech.org:user/myname/1/0

my bash asked me to input the password for metastasis@shtech.org all the times
then i did

  $ ssh -vvv metastasis@shtech.org

my bash returned

 debug1: Trying private key: /home/bob/.ssh/id_dsa
 debug1: Skipping ssh-dss key /home/bob/.ssh/id_dsa for not in PubkeyAcceptedKeyTypes

and skipped my id_dsa file
After asking my friends, i

 # nano /etc/ ssh/ssh_config

and deleted the ‘#’ before

IdentityFile ~/.ssh/id_dsa

it didn’t work on neither git clone nor ssh
Then i looked my question up in Google and added a line in /etc/ ssh/ssh_config

PubkeyAcceptedKeyTypes ssh-dss

it also didn’t work and returned

/ssh_config line 89 : Bad key types 'ssh-dss'

i changed ‘ssh-dss’ to ‘ssh-dsa’ or ‘id-dsa’ , but it still didn’t work
Now i finished it myself by adding PubkeyAcceptedKeyTypes ssh-dss after Host * like

Host *
    PubkeyAcceptedKeyTypes ssh-dss

and i cloned it successfully

    原文作者:星风
    原文地址: https://segmentfault.com/a/1190000004474081
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞