赞
踩
ssh-keygen -o -t rsa -C "email@example.com"
设置文件保存名称
Enter file in which to save the key (C:\Users\Administrator/.ssh/id_rsa): id_rsa_github
GitLab同理
生成文件如下图:
# gitlab # host 换成IP Host gitlab.com PreferredAuthentications publickey IdentityFile ~/.ssh/id_rsa_gitlab # github Host github.com PreferredAuthentications publickey IdentityFile ~/.ssh/id_rsa_github
ssh -vT git@github.com
C:\Users\Administrator>ssh -vT git@github.com
OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5
debug1: Reading configuration data C:\\Users\\Administrator/.ssh/config
debug1: C:\\Users\\Administrator/.ssh/config line 7: Applying options for github.com
debug1: Connecting to github.com [192.30.255.113] port 22.
debug1: Connection established.
****************************************************************************************
****************************************************************************************
****************************************************************************************
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
**Hi fanlizhichzu! You've successfully authenticated, but GitHub does not provide shell access.
debug1: channel 0: free: client-session, nchannels 1**
Transferred: sent 2560, received 2612 bytes, in 0.6 seconds
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。