I'm trying to write a helper application that will feed off a list of servers I need to connect to, then execute an SSH connect command.
I'm currently trying this:
Process p = Runtime.getRuntime().exec(new String[]{"bash","-c","ssh user@stackoverflow.com "});
Which does what it's supposed to, it executes the command. My servers are all key based authentication only, so SSH responds by asking for the key passphrase. At this stage, you can't actually interact SSH to enter the password.
Any ideas how I can work around this?
Thanks in advance!
Edit: For clarity, I need a way to either spin off to a new SSH process that the user can interact ssh with properly.