E
E
Elena2020-09-13 14:02:48
git
Elena, 2020-09-13 14:02:48

How to deal with two ssh keys?

Hello! Please help me deal with this situation.
I have ssh keys on the server. The .ssh folder contains the following files:

authorized_keys
id_rsa
id_rsa.pub
known_hosts

Public key id_rsa.pub, tied to github. Everything works as it should, but I can’t work with the git on the PC, because the keys are different. If I link the public key that is on the PC to the github, it will work, but then it will stop working on the server. How to solve this problem?

Decided. Answer in the comments

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
RTFMaster, 2020-09-13
@RTFMaster

Assign appropriate attributes to hosts in ~/.ssh/config.
Something like this:

Host example.org
    IdentityFile ~/.ssh/id_rsa_example_org

https://linuxize.com/post/using-the-ssh-config-file/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question