SSH (Secure SHell)is a cryptographic network protocol for operating network services securely over an unsecured network. Typical applications include remote command-line login and remote command execution.
Windows 配置
Step 1: Checking for existing SSH keys
- Open
Git Bash
- Type
ls -al ~/.ssh
- 如果提示
No such file or directory
说明没有建立过 SSH keys,可以第二步新建了 - 如果发现有
xxx.pub
文件,说明之前建立过。可以使用。
Step 2:Generating a new SSH key and adding it to the ssh-agent
- Open
Git Bash
- Type
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
- Type
eval $(ssh-agent -s)
to make sure ssh-agent is running - Type
ssh-add ~/.ssh/id_rsa
to add the SSH key to ssh-agent.
Step 3: Add SSH public key to Github
- Type
clip < ~/.ssh/id_rsa.pub
to copy SSH key to clipboard - Go to
Gitbub -> Settings -> SSH & GPG Keys -> New SSH Keys
, Name it and paste it. - Type
ssh -T git@github.com
to connect, then typeyes
to confirm the connection.