3

I am trying to open a remote shell via ssh to send commands from R. As long as I send commands, I need to get results and send new commands that depends on the output of the previous ones.

For this reason I am looking for a solution to open a connection and manage it from within the R code until I have finished. I also need to open the connection with ssh key exchange (so without password authentication).

Looking at CRAN I didn't find anything useful.

marpo_it
  • 1,289
  • 2
  • 8
  • 9
  • 1
    What are you trying to accomplish? If it is running R code on a server, solutions like `Rserve` allow you to do just that. – Paul Hiemstra Nov 04 '13 at 10:06
  • Would `system` or `shell` cut it? – Roman Luštrik Nov 04 '13 at 13:41
  • I need to launch some commands and capture the output on a remote machine connecting with ssh. My R program is on a local pc. I investigated system() and shell() but, as far as I understood, you cannot interact with the remote shell without opening and closing the ssh connection for each invocation of system(). – marpo_it Nov 04 '13 at 13:43
  • My question comes from the need to run some R code after the invocation of each command at the remote machine. I would like to avoid opening and closing the ssh connection each time. – marpo_it Nov 04 '13 at 13:52

1 Answers1

0

Consider CRAN packages:

RCurl supports scp

ssh.utils supports also remote execution and monitoring:

https://github.com/collectivemedia/ssh.utils/tree/master/man

hute37
  • 197
  • 2
  • 8