ssh-keygen -t rsa -C "lining@orgtec.cn" Creates a new ssh key using the provided email Generating public/private rsa key pair. #此处输入将要保存的路径,默认为当前路径 Enter file in which to save the key (/Users/your_user_directory/.ssh/id_rsa):<press enter> 输入回车后提示输入一个类似于密码的自定义的通行证号,如果直接回车则为空 Enter passphrase (empty for no passphrase):<enter a passphrase> #提示重新输入以便确认输入是否正确 Enter same passphrase again:<enter passphrase again>
查看新的key:
vi ~/.ssh/id_rsa.pub
将内容添加到服务器上。
从远程服务器克隆项目代码到本地:
[root@localhost wakav]# git clone ssh://lining@IP:8849/wakav正克隆到 'wakav'...Unable to negotiate with 114.215.120.180: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1fatal: Could not read from remote repository.Please make sure you have the correct access rights and the repository exists.