{"id":13423485,"url":"https://github.com/ropensci/ssh","last_synced_at":"2026-02-19T08:34:39.572Z","repository":{"id":47260293,"uuid":"83588293","full_name":"ropensci/ssh","owner":"ropensci","description":"Native SSH client in R based on libssh","archived":false,"fork":false,"pushed_at":"2025-03-26T22:23:36.000Z","size":944,"stargazers_count":130,"open_issues_count":25,"forks_count":21,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-10-21T19:47:03.348Z","etag":null,"topics":["libssh","r","r-package","rstats","ssh","ssh-client"],"latest_commit_sha":null,"homepage":"https://docs.ropensci.org/ssh","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ropensci.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-01T18:39:54.000Z","updated_at":"2025-10-06T09:20:56.000Z","dependencies_parsed_at":"2023-01-20T03:46:39.288Z","dependency_job_id":"f46b540a-0c7f-4a9c-8083-52358edb2dab","html_url":"https://github.com/ropensci/ssh","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/ropensci/ssh","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ropensci%2Fssh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ropensci%2Fssh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ropensci%2Fssh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ropensci%2Fssh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ropensci","download_url":"https://codeload.github.com/ropensci/ssh/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ropensci%2Fssh/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29608560,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T06:47:36.664Z","status":"ssl_error","status_checked_at":"2026-02-19T06:45:47.551Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["libssh","r","r-package","rstats","ssh","ssh-client"],"created_at":"2024-07-31T00:00:35.724Z","updated_at":"2026-02-19T08:34:39.540Z","avatar_url":"https://github.com/ropensci.png","language":"C","readme":"# SSH\n\n[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active)\n[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/ssh)](http://cran.r-project.org/package=ssh)\n[![CRAN RStudio mirror downloads](http://cranlogs.r-pkg.org/badges/ssh)](http://cran.r-project.org/web/packages/ssh/index.html)\n\n\u003e Secure Shell (SSH) Client for R\n\n## Installation\n\nThis package is available on CRAN and can be installed via:\n\n```r\ninstall.packages('ssh')\n```\n\nAlternatively it can be installed from source using `devtools`:\n\n```r\nremotes::install_github('ropensci/ssh')\n```\n\nInstallation from source on MacOS or Linux requires [`libssh`](https://www.libssh.org/) (the original `libssh`, __not__ the unrelated `libssh2` library). On __Debian__ or __Ubuntu__ use [libssh-dev](https://packages.debian.org/testing/libssh-dev):\n\n```\nsudo apt-get install -y libssh-dev\n```\n\nOn __Fedora__ we need [libssh-devel](https://src.fedoraproject.org/rpms/libssh):\n\n```\nsudo yum install libssh-devel\n````\n\nOn __CentOS / RHEL__ we install [libssh-devel](https://src.fedoraproject.org/rpms/libssh) via EPEL:\n\n```\nsudo yum install epel-release\nsudo yum install libssh-devel\n```\n\nOn __OS-X__ use [libssh](https://github.com/Homebrew/homebrew-core/blob/master/Formula/libssh.rb) from Homebrew:\n\n```\nbrew install libssh\n```\n\nUsing __conda__ (need a conda R environment `conda create -n Renv r-base r-essentials`)\n\n```\nconda install --channel conda-forge r-ssh\n```\n\nIf you have issues with the conda installation please submit an issue in [`conda-forge/r-ssh-feedstock`](https://github.com/conda-forge/r-ssh-feedstock/issues)\n\n## Getting Started\n\nFirst create an ssh session by connecting to an SSH server. You can either use private key or passphrase authentication: \n\n```{r}\nsession \u003c- ssh_connect(\"jeroen@dev.opencpu.org\")\n```\n\nYou can use the session in subsequent ssh functions below.\n\n### Run a command\n\nRun a command or script on the host while streaming stdout and stderr directly to the client.\n\n```{r}\nssh_exec_wait(session, command = c(\n  'curl -fOL https://cloud.r-project.org/src/contrib/Archive/jsonlite/jsonlite_1.5.tar.gz',\n  'R CMD check jsonlite_1.5.tar.gz',\n  'rm -f jsonlite_1.5.tar.gz'\n))\n```\n\nIf you want to capture the stdout/stderr:\n\n```r\nout \u003c- ssh_exec_internal(session, \"R -e 'rnorm(100)'\")\ncat(rawToChar(out$stdout))\n```\n#### Using 'sudo'\n\nNote that the exec functions are non interactive so they cannot prompt for a sudo password. A trick is to use `-S` which reads the password from stdin:\n\n```\nout \u003c- ssh_exec_wait(session, 'echo \"mypassword!\" | sudo -s -S apt-get update -y')\n```\n\nBe very careful with hardcoding passwords!\n\n### Uploading and Downloading via SCP\n\nUpload and download files via SCP. Directories are automatically traversed as in `scp -r`.\n\n```r\n# Upload a file to the server\nfile_path \u003c- R.home(\"COPYING\")\nscp_upload(session, file_path)\n```\n\n```r\n# Download the file back and verify it is the same\nscp_download(session, \"COPYING\", to = tempdir())\ntools::md5sum(file_path)\ntools::md5sum(file.path(tempdir(), \"COPYING\"))\n```\n\n### Create a Tunnel\n\nOpens a port on your machine and tunnel all traffic to a custom target host via the SSH server.\n\n```r\nssh_tunnel(session, port = 5555,target = \"ds043942.mongolab.com:43942\")\n```\n\nThis function blocks while the tunnel is active. Use the tunnel by connecting to `localhost:5555` from a separate process. The tunnel can only be used once and will automatically be closed when the client disconnects.\n\n### Disconnect\n\n\nWhen you are done with the session you should disconnect:\n\n```r\nssh_disconnect(session)\n```\n\nIf you forgot to disconnect, the garbage collector will do so for you (with a warning).\n","funding_links":[],"categories":["C"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fropensci%2Fssh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fropensci%2Fssh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fropensci%2Fssh/lists"}