GitLab & GitHub同时存SSH Key

来源:互联网 发布:歌曲字幕制作软件 编辑:程序博客网 时间:2024/05/16 18:01

GitLab & GitHub同时存SSH Key

我的github pages 地址:https://alexanderwangsgithub.github.io/

Add SSHKey(for github)

1. Generate a new SSHKey

ssh-keygen -t rsa -b 4096 -C "wg1033755123@gmail.com"

2. Check ssh agent

eval "$(ssh-agent -s)"

3. Add SSH key to ssh-agent

ssh-add ~/.ssh/id_rsa_github

4. Add SSHKey to github accout

pbcopy < ~/.ssh/id_rsa_github.pub

github link: https://github.com/settings/ssh

Manage SSHKey for different git

vi ~/.ssh/config

Host *github.com*    User git    IdentityFile ~/.ssh/id_rsa_githubHost *git.elenet.me*    User git    IdentityFile ~/.ssh/id_rsa
0 0
原创粉丝点击