D
D
Dmitrii Solovev2015-06-01 10:40:11
linux
Dmitrii Solovev, 2015-06-01 10:40:11

What is the correct way to use ssh-agent?

In general, I'm trying to deal with ssh-agent. There are for example 7 keys for different servers.
I used to bind via .ssh/config like this:

host bind-hostname
  HostName 100.100.100.1
  User username
  IdentityFile ~/.ssh/keyname

That allowed to conveniently log in to the server. But there is one limitation, this only applies to the bind-hostname that I set. That is, when entering ssh [email protected] without it, the key is no longer pulled up and must be specified manually via -i.
Here I found ssh-agent. You can add keys to it and he will manage them himself. Works both through a bound host and without it. The only problem is that it iterates over everything from 1 to 7 to any connection and does not remember the host.
This leads to the fact that very often I get the message "Too many authentication failures" when, for example, I need to log in with a password or with a key that is in place greater than 6.
This happens, because on servers, sshd mostly defaults to 6 as the maximum number of connection attempts.
How can I force ssh-agent not to do a constant enumeration, but to remember the hosts?
Or use it correctly?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
L
Lynn "Coffee Man", 2015-06-01
@Lynn

What's stopping you from writing

host bind-hostname 100.100.100.1
  Hostname 100.100.100.1
  User username
  IdentityFile ~/.ssh/keyname

ssh-agent allows you not to enter passphrase every time, but you still need to steer the choice from the config.

O
O Di, 2015-06-01
@insiki

The answer seems to be here:
SSH for frequent use

S
sudo rm -rf /, 2017-09-01
@MaxLevs

Why turn to ssh [email protected]100.1when you can turn to ? Then there are no problems with the keys if you use the same key for each bind-hostname user. And if the keys of different users of the machine are unique, then you can list them in the same config or, if there are more than 6 of them, name the keys according to a specific system using the host name and user, and set the key name in the config using % h and % r. ssh [email protected]bind-hostname

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question