ccontavalli / ssh-ident

Different agents and different keys for different projects, with ssh.
Other
965 stars 71 forks source link

When running w/o a host, ssh-ident should not load any keys #44

Open gzm55 opened 6 years ago

gzm55 commented 6 years ago

HI,

When using ssh-ident to wrap ssh, if call as ssh or ssh -o xxx without a host, we could mean to detect some feature of ssh or see the help. In these cases, the better way IMO is just call the real ssh without loading keys.

Further more, even if with host, we may still want to skip ssh-agent operations, such as ssh -O ctl_cmd host.example.com.

Can we detect these scenarios more precisely?

maddes-b commented 2 years ago

Recognizing all those scenarios would be annoying and a never ending task, as there could be endless combinations where loading keys is not necessary.

It's easier to just call the original ssh directly with its path, e.g. /usr/bin/ssh. In scripts this only has to be done once. For interactive sessions an shell alias would reduce typing and avoid knowing the correct path, e.g alias sshorg='/path/to/original/ssh'. Define it in your .profile