Run command before open a tunnel

Hello,

Is it possible to run a command before opening a tunnel.
I would like to start a "SecurID-App" to get the password for the 2FA authentication.

Best Regards
Stefan

There is a few ways:

  1. Use ProxyCommand
  2. Or Match directive
  3. And last one, Use AppleScript to automate tasks

Both ProxyCommand and Match ways require you install and enable Core Helper, and then edit and set directives in ~/etc/.ssh/config file.

Let me know if you need assistance.

Kindly Regards,

Yang

Hell Yang,

thank you for your help.
A line with a Match directive in .ssh/config was the solution:

Match host myhost exec "/Users/uuuuu/run_securid.sh"

Kindly Regards,
Stefan

1 Like