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$
18
$\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$
  • $\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$ – Emilio Pisanty Feb 19 '16 at 16:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.