git生成秘钥之后同步到服务器

现在本地生成ssh私钥和公钥

 

    • 设置本地git用户配置

      $ git config --global user.name "username"
      $ git config --global user.email "user@email.com"

    • 创建SSH Key,私钥和公钥

      $ ssh-keygen -t rsa -C "user@email.com"

 

ssh-copy-id root@192.168.1.xxx
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
root@192.168.1.xxx's password:
Permission denied, please try again.
root@192.168.1.xxx's password:

 

posted @ 2016-11-16 14:32  午时的海  阅读(398)  评论(0编辑  收藏  举报