private-schrijfsels-en-noti.../2024/Github multiple users and k...

787 B

For pyrotechny.eu the user account pyrotechny-eu and custom SSH key is used. When using git ssh config can override the domain name and use it with different settings. This is needed for enhanced security about traceability. See below:

$ mkdir ~/.ssh && chmod 700 ~/.ssh
$ ssh-keygen -t ecdsa -b 521 -f $HOME/.ssh/id_ecda_pyrotechny_eu

.ssh/config:

Host gh_pyrotechny
	Hostname github.com
	User git
	IdentityFile ~/.ssh/id_ecda_pyrotechny_eu

.git/config:

jerry@Jerrys-iMac pyrotechny.eu % git remote -v
local	/Users/jerry/src/github.com/xor-gate/pyrotechny.eu (fetch)
local	/Users/jerry/src/github.com/xor-gate/pyrotechny.eu (push)
origin	gh_pyrotechny:pyrotechny-eu/pyrotechny.eu.git (fetch)
origin	gh_pyrotechny:pyrotechny-eu/pyrotechny.eu.git (push)