RStudio server through ssh

August 10, 2012
By

(This article was first published on Quantitative thoughts » EN, and kindly contributed to R-bloggers)

R language has numerous IDEs – RStudio, Vim plugin, Eclipse plugin. RStudio really shines for R language, nevertheless Vim plugin might be well adapted for R if you are Vim guru. Eclipse? Who needs such behemoth? Turns out a student in Ljubljana badly needs it.

Most of the time I use remote server for R related tasks, which I access through ssh. To get graphical UI and RStudio I use No Machine remote desktop client over ssh. I could use Vim, however I never managed to run it my way. The cool thing about RStudio that it comes in two flavours – desktop and server side. RStudio server version allows you to access R through web interface, meaning that you can use it remotely. Despite the fact I was afraid to open other port than ssh on remote machine for security reasons. The traffic between client and RStudio server is encrypted, however that does not eliminate vulnerabilities of RStudio itself. One way to come around this problem is to use Virtual Private Network, but installation of VPN is not that trivial.

During the holidays, when my brain was half empty, I started to wonder, if I really need VPN to access RStudio server in secure way. Well, not at all! What you have to do is to run SOCKS proxy on local machine, which is very easy on Linux/Mac:

ssh -D 2001 [email protected] 

Keep the connection open and then, open a web browser and set up all traffic to go through proxy on local machine and port 2001. Here is an example for Firefox:

  • enter about:config
  • change the value of network.proxy.socks to 127.0.0.1
  • change the value of network.proxy.socks_port to 2001
  • change the value of network.proxy.socks_version to 4
  • enter an internal address of remote server, something like http://192.168.0.120:8787/
  • enjoy R and data mining

If you need user friendly description of SOCKS proxy set up, refer this post. More information about RStudio server can be found here.

To leave a comment for the author, please follow the link and comment on his blog: Quantitative thoughts » EN.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.