I am having trouble setting up a remote kernel connection between my two Mac computers. The kernel on my iMac runs much faster than on my MacBook Pro, so I would like to run computations through my iMac when I am out of town.

I have set up ssh on my iMac and have no problem connecting to it via ssh in a Terminal window from my MacBook. I can even run the remote kernel from the command line by entering "/Applications/Mathematica.app/Contents/MacOS/MathKernel" without any problems. However I cannot set up a remote kernel from my front end despite putting this exact same command for "Kernel Program." Mathematica displays the "cannot connect to remote kernel" error before even asking me for a password to log into my remote machine. I am really at a loss as to what is wrong (I am not very familiar with computers at all) and any help would be appreciated.

  • $\begingroup$ There might be several reasons why it doesn't work, could you expand your question with all the steps you took? $\endgroup$
    – VLC
    Commented Jul 18, 2013 at 6:45
  • $\begingroup$ I have the exact same problem... I have no problem to connect to other kernels, but in the exact same case as the question here it fails without even asking for a password. $\endgroup$
    – Cedric H.
    Commented Oct 29, 2013 at 13:09
  • $\begingroup$ Related: How can I connect to a remote machine? $\endgroup$
    – ybeltukov
    Commented Dec 1, 2013 at 12:36

1 Answer 1


From my experience these problems all have to do with a proper ssh connection. Here is my recipe to handle the situation:

I will call the computer running the kernel server and the computer running the frontend connecting to the remote kernel client.

On the server side check that "Remote Login" is activated in Settings->Sharing. You should then be able to open terminal and connect to the server from your client using ssh like this:

ssh username@computer

where computer is either the computer name of the server in your network or the IP-address of the server. You should be asked a password for the user you specified via username. After successful login you should be able to run the MathKernel on the server via


If this gives you a command line mathematica session on the server we are set for the next step: Make a connection to the remote kernel from within a mathematica notebook on the client.

To do so open Evaluate->Kernel Configuration Options in Mathematica on the client machine. Choose Add to add a new remote kernel. In the appearing Options Dialog choose Advanced Options. Leave Arguments to MLOpen as is and specify a custom Launch command:

ssh username@computer /Applications/Mathematica.app/Contents/MacOS/MathKernel -mathlink -LinkMode Connect -LinkProtocol TCPIP -LinkName "`linkname`" -LinkHost `ipaddress`

As you can see I did not use the WolframSSH implementation but the standard ssh shipping with MacOS X.

Now the Kernel should be setup properly. Switch the Kernel for the notebook to the newly created remote kernel and run a command. If all works as expected you should get an error message in the messages window telling you "ssh_askpass: exec(/usr/libexec/ssh-askpass): No such file or directory".

This is due to the fact that this file does not exist on your client and MacOS X is configured to not showing any password dialog by default. This means that you need a proper ssh-askpass script (ssh-askpass is a shell script) that allows you to show the password dialog. To get one you should visit: proper ssh-askpass. You need to install the script on your client, just follow the installation instructions on the website.

That's it, you should now be able to connect to the remote kernel in mathematica, i.e. when executing a command a password dialog should show up and after the password has been entered the command should be executed on the server running the remote kernel.

p.s.: Instead of using the password dialog and setting up a proper ssh-askpass script you should also be able to establish a ssh-connection by setting up proper ssh keys on both machines and specify this key in the advanced options under Launch commands.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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