Re: [R] Executing a telnet session from R

From: Claus Wilke <cwilke_at_mail.utexas.edu>
Date: Sun, 06 Apr 2008 19:44:08 -0500

Don't use telnet, use rsh or (better) ssh. You can set up your identity on the remote host so that ssh doesn't ask for your password (see ssh documentation), and you can give ssh the command(s) that should be executed on the remote host (again see ssh documentation).

Claus

On Sunday 06 April 2008, Dennis Fisher wrote:
> Colleagues
>
> I am working in a Linux OS with R 2.6.2.
>
> I need to execute a telnet session to another Linux machine from R,
> perform some operations, then return to the original computer. When I
> am in an R session, this is easy to accomplish by typing:
> system("telnet -l username machinename")
> I am then asked for my password; once that is entered, I am connected
> to the remote machine. I can then enter commands on the remote
> machine, then logout.
>
> I would like to automate this process within a function. Obviously, I
> can embed the 'system' command in the function.
>
> Questions:
> 1. How do I enter the password into the command?
> 2. How do I execute the commands on the other machine?
> 3. Finally, how do I execute the 'logout' command (this should not
> differ from #2)?
>
> Thanks in advance for any help on this.
>
> Dennis
>
> Dennis Fisher MD
> P < (The "P Less Than" Company)
> Phone: 1-866-PLessThan (1-866-753-7784)
> Fax: 1-415-564-2220
> www.PLessThan.com
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html and provide commented, minimal,
> self-contained, reproducible code.

-- 
Claus Wilke
Section of Integrative Biology 
 and Center for Computational Biology and Bioinformatics 
University of Texas at Austin
1 University Station C0930
Austin, TX 78712
cwilke_at_mail.utexas.edu
512 471 6028

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Mon 07 Apr 2008 - 00:47:36 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 07 Apr 2008 - 01:30:30 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive