title: Establishing ssh connection from within RStudio on linux
body: <p>I am trying to pull a file from another computer into R environment in RStudio on Centos 6</p>
  
  <p>I've tried it in plain R first and when I issue </p>
  
  <pre><code>readLines(pipe( 'ssh root@X.X.X.X "cat /path/somefile.sh"' ))
  </code></pre>
  
  <p>it correctly asks me for the password of my ssh key and reads the contents.</p>
  
  <p>However if the same command is executed from RStudio all I get is:</p>
  
  <pre><code>ssh_askpass: exec(rpostback-askpass): No such file or directory
  Permission denied, please try again.
  ssh_askpass: exec(rpostback-askpass): No such file or directory
  Permission denied, please try again.
  ssh_askpass: exec(rpostback-askpass): No such file or dire
  Permission denied (publickey,gssapi-with-mic,password).
  </code></pre>
  
  <p>I suspect that the reason is because rstudio on centos actually uses rstudio-server user (and gui is provided in a browser). Does anyone know how to properly access ssh'd resources from it ?</p>
  
  <p>UPD: after executing </p>
  
  <pre><code>Sys.setenv(PATH = paste0(Sys.getenv('PATH'), ':/usr/lib/rstudio-server/bin/postback'))
  </code></pre>
  
  <p>as suggested below it won't output askpass errors, but it still does not work. Now it seems that the console is waiting for the command to execute indefinitely</p>