Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have several servers and different users. Also i have two different authorize method: via keys and password.

When i try login ssh recheck all public keys. Is there method to bind public key and server?

Here is verbose :

ssh -v root@serv

debug1: Offering RSA public key: /home/user/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password
debug1: Offering RSA public key: user1@web3
debug1: Authentications that can continue: publickey,password
debug1: Offering RSA public key: user2@web2
debug1: Authentications that can continue: publickey,password
debug1: Offering RSA public key: root@web1
debug1: Authentications that can continue: publickey,password
debug1: Offering RSA public key: user3@web3
share|improve this question

1 Answer 1

You can use a ~/.ssh/config file and put per host configuration details in it

Host serv1
    hostname serv1.example.com
    user serv1user
    IdentityFile ~/.ssh/serv1user.key

Host serv2
    hostname serv2.example.com
    user root
    IdentityFile ~/.ssh/rootserv2.key

Host serv3
    user root
    IdentityFile ~/.ssh/rootserv3.key

Now you can ssh serv1 etc and the relevant details will be picked up from the configutation file.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.