how do you connect to a remote server with ssh in R
There is direct support for ssh/scp in RCurl:
x = scp("remote.ssh.host.com", "/home/dir/file.txt", "My.SCP.Passphrase", user="username")
Connect to a server by R (with cmd.exe)
If anybody has the same question in the future:
You have to write
telnet adress.net Portnumber
into cmd.exe. After that you can log in. But
system(command = "telnet adress.net Portnumber")
shell(cmd = "telnet adress.net Portnumber")
did not both not work so i used following function:
con <- socketConnection("adress.net", port = Portnumber, server=FALSE, open="r+b")
writeLines("Username\r", con)
writeLines("Password\r", con)
With that, you are good to go without cmd.exe
The output is not displayed correctly formatted when i get output with ssh connection remotely with python script
By default data in s.before
is of bytes
, not str
. You can decode when printing:
print(s.before.decode() )
You can ask it to automatically convert the data to str
by specifying an encoding
:
s = pxssh.pxssh(encoding='utf8')
...
print(s.before)
Related Topics
Devtools::Install_Github() - Ignore Ssl Cert Verification Failure
How to Paste Together the Elements of a Vector in R Without Using a Loop
R: What's the How to Overwrite a Function from a Package
Overlay Geom_Points() on Geom_Boxplot(Fill=Group)
Dplyr::Do() Requires Named Function
Unknown Timezone Name in R Strptime/As.Posixct
Format Ttest Output by R for Tex
How to Calculate Any Negative Number to the Power of Some Fraction in R
Substitute Dt1.X with Dt2.Y When Dt1.X and Dt2.X Match in R
How to Produce a Heatmap with Ggplot2
Assigning Null to a List Element in R
How to Reorder the Items in a Legend
Grouping Every N Minutes with Dplyr
Set a Functions Environment to That of the Calling Environment (Parent.Frame) from Within Function
Convert Quarter/Year Format to a Date