How can I tell ssh with a command line option to not use the SSH-Agent?
ssh -a
does something different. It does not forward the agent, but uses it.
I read the man page, and could not find a solution.
Unsetting SSH_AUTH_SOCK
would work, but a command line option would be much better in my context.
Shutting Down the ssh-agent You can shut down the ssh-agent by running the command eval `ssh-agent –k` . This command uses the SSH_AGENT_PID variable to send a signal to the ssh-agent process to shut it down. The command also unsets the environment variables that were set when you started the ssh-agent .
The default is the name given on the command line. Numeric IP addresses are also permitted (both on the command line and in HostName specifications). IdentitiesOnly. Specifies that ssh(1) should only use the authentication identity files configured in the ssh_config files, even if ssh-agent(1) offers more identities.
You can force ssh
to use anything else than a SSH key to authenticate (e.g. password) with
ssh -o PubkeyAuthentication=no ...
this way of course the agent will be ineffective. If you want to use a key, you can also specify it explicitly and ssh will only use that key and not all that are in the agent:
ssh -i path/to/id_rsa -o IdentitiesOnly=yes -F /dev/null ...
You mentioned SSH_AUTH_SOCK
. You can unset it just in the context of your ssh
command like this:
SSH_AUTH_SOCK= ssh ...
Note the space after SSH_AUTH_SOCK=
. This way your are sure that the agent is not used while at the same time not modifying your working environment.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With