mkdir -p ~/.ssh cd ~/.ssh/ ssh-keygen -t rsa -C "[email protected]" # Name the file id_rsa_xiaomi and press Enter all the way ssh-keygen -t rsa -C "[email protected]" # Name this file id_rsa_github, and press Enter all the way # At this point, two pairs of public and private keys are generated under ~/.ssh touch config chmod 600 ~/.ssh/* Add the following to #config: host git.n.xiaomi.com user git hostname git.n.xiaomi.com port 22 identityfile ~/.ssh/id_rsa_xiaomi host github.com user git hostname github.com port 22 identityfile ~/.ssh/id_rsa_github # cat ~/.ssh/id_rsa_xiaomi.pub paste the content of xiaomi's ssh keys # cat ~/.ssh/id_rsa_github.pub paste the content of github's ssh keys