Commit 8013da4
committed
Offer only the deployment key when ssh-ing to instances
Net::SSH fills in identity sources the caller does not name: every
IdentityFile from ~/.ssh/config, which it tries ahead of :key_data, and
every identity held by a reachable ssh-agent. On a workstation with a
'Host *' block or a loaded agent that is enough extra identities to
exhaust the target sshd's MaxAuthTries, so the server disconnects and
the example dies with 'Too many authentication failures'.
Pin the identity set to the key BATs was given. :keys_only on its own
does not do it: it filters agent identities but leaves the ones the
config file contributed, so :keys has to be cleared as well. Parsing of
~/.ssh/config stays on, so directives such as ProxyJump and Port keep
working.1 parent 31057b3 commit 8013da4
2 files changed
Lines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
66 | 76 | | |
67 | 77 | | |
68 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
52 | 66 | | |
53 | 67 | | |
54 | 68 | | |
| |||
0 commit comments