CentOS Git导入SSH key

CentOS下Git导入SSH key

ssh-agent bash --login -i
ssh-add -k /path/to/key

如果不执行ssh-agent bash --login -i会报错:Could not open a connection to your authentication agent.

导入完成后就可以执行

git clone git_repo_path

其实不导入老的key也行,完全可以用ssh-keygen生成一套,再把公钥添加到阿里云Code、Github等Git服务的公钥中去,因为一个账户下是可以有多个公钥的。

Leave a Comment

豫ICP备19001387号-1