惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

U
Unit 42
Blog — PlanetScale
Blog — PlanetScale
H
Help Net Security
The GitHub Blog
The GitHub Blog
博客园 - Franky
酷 壳 – CoolShell
酷 壳 – CoolShell
Recent Announcements
Recent Announcements
量子位
aimingoo的专栏
aimingoo的专栏
大猫的无限游戏
大猫的无限游戏
博客园 - 叶小钗
Microsoft Azure Blog
Microsoft Azure Blog
Martin Fowler
Martin Fowler
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
A
About on SuperTechFans
T
Tailwind CSS Blog
V
V2EX
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
B
Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
S
SegmentFault 最新的问题
G
Google Developers Blog
M
MIT News - Artificial intelligence

/home/hexchain

在 Linux 上使用 Docker 和 Java 开发酷 Q 插件 跨架构升级 Fedora 使用 networkd 管理 HE.net TunnelBroker LaTeX 笔记 OpenWrt 编译配置笔记 tar 分卷压缩与解压缩 Linux 上使用财付通控件
为不同 GitHub repo 使用不同 ssh key
hexchain · 2013-11-21 · via /home/hexchain

最近在折腾 mirrors 的时候发现 scripts 和 web 两个不同的仓库不能有同一个 ssh identity,于是就在服务器上生成了两个 ssh key,稍微修改了下配置文件,使得两个 repo 在 push 的时候能使用对应的 identity。

两个 identity 分别命名为 id_rsa_scripts 和 id_rsa_web ,存储在 ~/.ssh/ 目录下。

~/.ssh/config

Host github-repo-scripts
    Hostname github.com
    IdentityFile ~/.ssh/id_rsa_scripts

Host github-repo-web
    Hostname github.com
    IdentityFile ~/.ssh/id_rsa_web

~/scripts/.git/config 修改 [remote "origin"] 下 url 一项的值:

url = git@github-repo-scripts:UniqueStudio/mirrors-script.git

~/mirrorweb/.git/config 修改 [remote "origin"] 下 url 一项的值:

url = git@github-repo-web:UniqueStudio/mirrors-web.git