21
$\begingroup$

On all of the servers that I regularly interact with, I have ssh-keys setup for passwordless access via ssh. Yet, every time I attempt to start a remote-kernel over ssh, I get asked for a password despite having a ssh-keyagent up and running. What do I need to add to the kernel configuration, such as the launch command, to have it use my ssh-key?

I'm using version 8.0.4 on MacOS 10.6.8, if it makes a difference.

$\endgroup$
2
  • $\begingroup$ See this: mathematica.stackexchange.com/questions/28274/… $\endgroup$ Commented Oct 2, 2017 at 19:03
  • $\begingroup$ @Karolis neat. I'll have to look through it. $\endgroup$ Commented Oct 2, 2017 at 21:00

1 Answer 1

19
$\begingroup$

Mathematica by default uses its own ssh implementation. You can see it in the dialog of the remote kernel configuration dialog in the advanced options: `java` -jar `mathssh`. As far as I know, you can safely replace that with the local ssh command (most likely /usr/bin/ssh). You have to select the "Advanced Options" radiobutton to do that (if you first add all the standard options, the rest of the command is already filled in correctly).

Edit: By default, Mathematica uses the launch command

`java` -jar "`mathssh`" user@hostname math -mathlink -LinkMode Connect -LinkProtocol TCPIP -LinkName "`linkname`" -LinkHost `ipaddress` 

to invoke ssh, where user and hostname are filled in via text boxes above. To use the local ssh command, you need to change the above command to

ssh user@hostname "math -mathlink -LinkMode Connect -LinkProtocol TCPIP -LinkName `linkname` -LinkHost `ipaddress`" 

This appears to have one flaw, killing the remote kernel via the front-end no longer kills the processes on the remote server. So, that will have to be done by hand.

$\endgroup$
2
  • 1
    $\begingroup$ This answer looks a bit outdated - 10.3 shows wolframssh instead of mathssh as the default. Probably that doesn't change much but it would be good to check. $\endgroup$ Commented Feb 19, 2016 at 16:38
  • $\begingroup$ I can confirm that as of April 28, 2025 - the above still works....this also gets rid of the (rather annoying) java window/program that mathematica opens...for reference to future readers, I'm using "wolframscript" rather than "wolfram" as my kernel on the remote server and have setup a SSH Key to login without being prompted for password $\endgroup$ Commented Apr 27 at 16:38

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.