Git Product home page Git Product logo

Comments (2)

hafen avatar hafen commented on August 24, 2024

I have done multi-hop ssh with forwarding in the past but it's been a while. This should be possible - see, for example, the second answer to this question here: https://superuser.com/questions/96489/an-ssh-tunnel-via-multiple-hops

from rmote.

lcolladotor avatar lcolladotor commented on August 24, 2024

Hi,

I got it to work with the SGE cluster I have access by taking advantage of the names of the compute machines in our SGE cluster. All nodes start with compute. So this is what I have:

Local machine ~./ssh/config:

Host sge
    User my_username
    Hostname my_cluster@somewhere
    LocalForward 4321 localhost:4321
    ForwardX11 yes
    ForwardX11Trusted yes

I guess that forwarding X11 is there for historical reasons, or in case that rmote fails and you don't want to have to restart your terminal.

    ForwardX11 yes
    ForwardX11Trusted yes

~/.ssh/config at SGE cluster

Set up local forwarding for all compute nodes in my SGE cluster. This http://pentestmonkey.net/cheat-sheet/ssh-cheat-sheet was useful to me btw because I tried first with RemoteForward.

Host compute*
    LocalForward 4321 localhost:4321

~/.Rprofile at SGE

Force all different terminal windows to use the same server_dir for start_rmote() so that they all update in the same location.

## rmote for images
# https://github.com/cloudyr/rmote
installed <- require('rmote')
if(!installed) {
    cat('install.packages("rmote", repos = c(CRAN = "http://cran.rstudio.com",
tessera = "http://packages.tessera.io"))')
} else {
    start_rmote(port = 4321, server_dir = '/users/my_username/rmote/rmote_server')

    ## This also works
    # start_rmote(port = 4321, server_dir = paste0('/users/my_username/rmote/rmote_server_', Sys.Date()))
}
rm(installed)

In reality I chose a different number from 4321 for the port, so that it won't conflict with other users if they use the default value in rmote::start_rmote().

Best,
Leo

Session info

> options(width = 120); devtools::session_info()
Session info ----------------------------------------------------------------------------------------------------------
 setting  value
 version  R version 3.4.3 Patched (2018-01-20 r74142)
 system   x86_64, linux-gnu
 ui       X11
 language (EN)
 collate  en_US.UTF-8
 tz       US/Eastern
 date     2018-02-16

Packages --------------------------------------------------------------------------------------------------------------
 package     * version date       source
 base        * 3.4.3   2018-01-20 local
 colorout    * 1.1-2   2017-08-10 Github (jalvesaq/colorout@020a14d)
 colorspace    1.3-2   2016-12-14 CRAN (R 3.4.1)
 compiler      3.4.3   2018-01-20 local
 datasets    * 3.4.3   2018-01-20 local
 devtools      1.13.4  2017-11-09 CRAN (R 3.4.2)
 digest        0.6.15  2018-01-28 cran (@0.6.15)
 ggplot2       2.2.1   2016-12-30 CRAN (R 3.4.1)
 graphics    * 3.4.3   2018-01-20 local
 grDevices   * 3.4.3   2018-01-20 local
 grid          3.4.3   2018-01-20 local
 gtable        0.2.0   2016-02-26 CRAN (R 3.4.1)
 htmltools     0.3.6   2017-04-28 CRAN (R 3.4.1)
 htmlwidgets   0.9     2017-07-10 CRAN (R 3.4.1)
 httpuv        1.3.5   2017-07-04 CRAN (R 3.4.1)
 lattice       0.20-35 2017-03-25 CRAN (R 3.4.3)
 lazyeval      0.2.1   2017-10-29 CRAN (R 3.4.2)
 memoise       1.1.0   2017-04-21 CRAN (R 3.4.1)
 methods     * 3.4.3   2018-01-20 local
 mime          0.5     2016-07-07 CRAN (R 3.4.1)
 munsell       0.4.3   2016-02-13 CRAN (R 3.4.1)
 pillar        1.1.0   2018-01-14 CRAN (R 3.4.2)
 plyr          1.8.4   2016-06-08 CRAN (R 3.4.1)
 png           0.1-7   2013-12-03 CRAN (R 3.4.1)
 Rcpp          0.12.14 2017-11-23 CRAN (R 3.4.2)
 rlang         0.1.6   2017-12-21 CRAN (R 3.4.2)
 rmote       * 0.3.4   2018-02-16 deltarho (R 3.4.3)
 scales        0.5.0   2017-08-24 CRAN (R 3.4.1)
 servr         0.8     2017-11-06 CRAN (R 3.4.3)
 stats       * 3.4.3   2018-01-20 local
 tibble        1.4.1   2017-12-25 CRAN (R 3.4.2)
 tools         3.4.3   2018-01-20 local
 utils       * 3.4.3   2018-01-20 local
 withr         2.1.1   2017-12-19 CRAN (R 3.4.2)

PS I found about this project thanks to https://community.rstudio.com/t/feature-request-send-plots-from-r-in-terminal-to-plots-pane/1877/3

from rmote.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.