I have an R script on a remote server. The script needs my local display in order to generate plots.

me@local$ ssh -Y me@remote_ip
me@remote$ echo $DISPLAY

$ Rscript myscript.R
connect localhost port 6012: Connection refused

The script does the job, however I'd like to get rid of this connection error message. Ideally I'd like a solution to fix this. I read on some other threads that it would be my local computer that does not allow the connection from the remote server. I have no idea how to solve that as my mac System Preferences > Security & Privacy > Firewall shows the firewall is off. So how am I supposed to authorise the connection from the remote server back to my local computer? Unless the problem lies somewhere else.

  • Since you're running the command on the remote host, localhost in this case refers to the remote host, not the computer that you're connecting from. – jayhendren Nov 16 '16 at 18:01
  • Exactly. Following this idea, I generated the remote's ssh keys and put them in my local's ssh_authorized keys. Was it one right step to take? It does not solve the issue though – kaligne Nov 16 '16 at 21:19

Your Answer

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

Browse other questions tagged or ask your own question.