I'm trying to configure another GitHub account to be able work from my machine. I started to looking around and I found:
Set up multiple ssh profiles by creating/modifying ~/.ssh/config. Note the slightly differing 'Host' values:
So as I (already) have multiple accounts working (I don't remember how and when I did that) I wanted to just add another entry in ~/.ssh/config
. But it appears that I don't have such file. Maybe it is located somewhere else? Or maybe my machine is configured in some other way? Where to start searching?
I wanted to just add another entry in
~/.ssh/config
You can create it, but:
you need to have generate public/private keys with a different name
ssh-keygen -q -P "" -t rsa -f ~/.ssh/key2
you need to have registered ~/.ssh/key2.pub
on your remote server second account
you need to have a config file with:
Host github2
HostName github.com
User git
IdentityFile /home/me/.ssh/key2
Note the User here: 'git
', not 'another GitHub account
'
you need to change the origin remote URL to use that entry:
git remote set-url origin github2:MySecondAccount/MyRepo.git
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With