在cambridge上添加github sshkey方法:

来源:互联网 发布:matlab7,1如何编程 编辑:程序博客网 时间:2024/06/05 14:19

在cambridge上添加github sshkey方法:

  • $ssh-keygen 生成rsa公钥密钥对。按3次enter生成到默认路径~/.ssh中。
  • $vim rsa的public key,复制添加到github账户的sshkeys上。
  • 指定ssh端口:$touch .ssh/config,内容为

    TCPKeepAlive=yes
    ServerAliveInterval=15
    ServerAliveCountMax=6
    StrictHostKeyChecking=no
    Compression=yes
    ForwardAgent=yes
    Host your git host
    Port 3022 for cambridge
    User git

  • 然后git clone repo,可能提示Bad owner or permissions on $HOME/.ssh/config,这是因为sshkey和config文件的权限问题。解决方法:

    cd ~/.ssh
    chmod 600 *

0 0
原创粉丝点击