A summary of data about the Ruby ecosystem.

https://github.com/net-ssh/net-ssh

Pure Ruby implementation of an SSH (protocol 2) client
https://github.com/net-ssh/net-ssh

Keywords from Contributors

activerecord activejob mvc rubygems rack ruby-gem rspec rubocop code-formatter static-code-analysis

Last synced: about 3 hours ago
JSON representation

Repository metadata

Pure Ruby implementation of an SSH (protocol 2) client

README.md

Gem Version
Join the chat at https://gitter.im/net-ssh/net-ssh
Build status
Coverage status
Backers on Open Collective
Sponsors on Open Collective

Net::SSH 7.x

As of v2.6.4, all gem releases are signed. See INSTALL.

DESCRIPTION:

Net::SSH is a pure-Ruby implementation of the SSH2 client protocol.
It allows you to write programs that invoke and interact with processes on remote servers, via SSH2.

FEATURES:

  • Execute processes on remote servers and capture their output
  • Run multiple processes in parallel over a single SSH connection
  • Support for SSH subsystems
  • Forward local and remote ports via an SSH connection

Supported Algorithms

Net::SSH 6.0 disables by default the usage of weak algorithms.
We strongly recommend that you install a servers's version that supports the latest algorithms.

It is possible to return to the previous behavior by adding the option : append_all_supported_algorithms: true

Unsecure algoritms will definitely be removed in Net::SSH 8.*.

Host Keys

Name Support Details
ssh-rsa OK
ssh-ed25519 OK Require the gem ed25519
ecdsa-sha2-nistp521 OK using weak elliptic curves
ecdsa-sha2-nistp384 OK using weak elliptic curves
ecdsa-sha2-nistp256 OK using weak elliptic curves
ssh-dss Deprecated in 6.0 unsecure, will be removed in 8.0

Key Exchange

Name Support Details
curve25519-sha256 OK Require the gem x25519
ecdh-sha2-nistp521 OK using weak elliptic curves
ecdh-sha2-nistp384 OK using weak elliptic curves
ecdh-sha2-nistp256 OK using weak elliptic curves
diffie-hellman-group1-sha1 Deprecated in 6.0 unsecure, will be removed in 8.0
diffie-hellman-group14-sha1 OK
diffie-hellman-group-exchange-sha1 Deprecated in 6.0 unsecure, will be removed in 8.0
diffie-hellman-group-exchange-sha256 OK

Encryption algorithms (ciphers)

Name Support Details
aes256-ctr / aes192-ctr / aes128-ctr OK
chacha20-poly1305@openssh.com OK. Requires the gem rbnacl
aes256-cbc / aes192-cbc / aes128-cbc Deprecated in 6.0 unsecure, will be removed in 8.0
rijndael-cbc@lysator.liu.se Deprecated in 6.0 unsecure, will be removed in 8.0
blowfish-ctr blowfish-cbc Deprecated in 6.0 unsecure, will be removed in 8.0
cast128-ctr cast128-cbc Deprecated in 6.0 unsecure, will be removed in 8.0
3des-ctr 3des-cbc Deprecated in 6.0 unsecure, will be removed in 8.0
idea-cbc Deprecated in 6.0 unsecure, will be removed in 8.0
none Deprecated in 6.0 unsecure, will be removed in 8.0

Message Authentication Code algorithms

Name Support Details
hmac-sha2-512-etm OK
hmac-sha2-256-etm OK
hmac-sha2-512 OK
hmac-sha2-256 OK
hmac-sha2-512-96 Deprecated in 6.0 removed from the specification, will be removed in 8.0
hmac-sha2-256-96 Deprecated in 6.0 removed from the specification, will be removed in 8.0
hmac-sha1 OK for backward compatibility
hmac-sha1-96 Deprecated in 6.0 unsecure, will be removed in 8.0
hmac-ripemd160 Deprecated in 6.0 unsecure, will be removed in 8.0
hmac-md5 Deprecated in 6.0 unsecure, will be removed in 8.0
hmac-md5-96 Deprecated in 6.0 unsecure, will be removed in 8.0
none Deprecated in 6.0 unsecure, will be removed in 8.0

SYNOPSIS:

In a nutshell:

require 'net/ssh'

Net::SSH.start('host', 'user', password: "password") do |ssh|

# capture all stderr and stdout output from a remote process
output = ssh.exec!("hostname")
puts output

# capture only stdout matching a particular pattern
stdout = ""
ssh.exec!("ls -l /home/jamis") do |channel, stream, data|
  stdout << data if stream == :stdout && /foo/.match(data)
end
puts stdout

# run multiple processes in parallel to completion
ssh.exec "sed ..."
ssh.exec "awk ..."
ssh.exec "rm -rf ..."
ssh.loop

# open a new channel and configure a minimal set of callbacks, then run
# the event loop until the channel finishes (closes)
channel = ssh.open_channel do |ch|
  ch.exec "/usr/local/bin/ruby /path/to/file.rb" do |ch, success|
    raise "could not execute command" unless success

    # "on_data" is called when the process writes something to stdout
    ch.on_data do |c, data|
      $stdout.print data
    end

    # "on_extended_data" is called when the process writes something to stderr
    ch.on_extended_data do |c, type, data|
      $stderr.print data
    end

    ch.on_close { puts "done!" }
  end
end

channel.wait

# forward connections on local port 1234 to port 80 of www.capify.org
ssh.forward.local(1234, "www.capify.org", 80)
ssh.loop { true }
end

See Net::SSH for more documentation, and links to further information.

REQUIREMENTS:

The only requirement you might be missing is the OpenSSL bindings for Ruby with a version greather than 1.0.1.
These are built by default on most platforms, but you can verify that they're built and installed on your system by running the following command line:

ruby -ropenssl -e 'puts OpenSSL::OPENSSL_VERSION'

If that spits out something like OpenSSL 1.0.1 14 Mar 2012, then you're set.
If you get an error, then you'll need to see about rebuilding ruby with OpenSSL support,
or (if your platform supports it) installing the OpenSSL bindings separately.

INSTALL:

gem install net-ssh # might need sudo privileges

NOTE: If you are running on jruby on windows you need to install jruby-pageant manually
(gemspec doesn't allow for platform specific dependencies at gem installation time).

However, in order to be sure the code you're installing hasn't been tampered with,
it's recommended that you verify the signature.
To do this, you need to add my public key as a trusted certificate (you only need to do this once):

# Add the public key as a trusted certificate
# (You only need to do this once)
curl -O https://raw.githubusercontent.com/net-ssh/net-ssh/master/net-ssh-public_cert.pem
gem cert --add net-ssh-public_cert.pem

Then, when install the gem, do so with high security:

gem install net-ssh -P HighSecurity

If you don't add the public key, you'll see an error like "Couldn't verify data signature".
If you're still having trouble let me know and I'll give you a hand.

For ed25519 public key auth support your bundle file should contain ed25519, bcrypt_pbkdf dependencies.

gem install ed25519
gem install bcrypt_pbkdf

For curve25519-sha256 kex exchange support your bundle file should contain x25519 dependency.

RUBY SUPPORT

RUNNING TESTS

If you want to run the tests or use any of the Rake tasks, you'll need Mocha and
other dependencies listed in Gemfile

Run the test suite from the net-ssh directory with the following command:

bundle exec rake test

NOTE : you can run test on all ruby versions with docker :

docker-compose up --build

Run a single test file like this:

ruby -Ilib -Itest test/transport/test_server_version.rb

To run integration tests see here

BUILDING GEM

rake build

GEM SIGNING (for maintainers)

If you have the net-ssh private signing key, you will be able to create signed release builds. Make sure the private key path matches the signing_key path set in net-ssh.gemspec and tell rake to sign the gem by setting the NET_SSH_BUILDGEM_SIGNED flag:

NET_SSH_BUILDGEM_SIGNED=true rake build

For time to time, the public certificate associated to the private key needs to be renewed. You can do this with the following command:

gem cert --build netssh@solutious.com --private-key path/2/net-ssh-private_key.pem
mv gem-public_cert.pem net-ssh-public_cert.pem
gem cert --add net-ssh-public_cert.pem

or rake cert:update_public_when_expired

Security contact information

See SECURITY.md

CREDITS

Contributors

This project exists thanks to all the people who contribute.

contributors

Backers

Thank you to all our backers! šŸ™ Become a backer

backers

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. Become a sponsor

Sponsor

LICENSE:

(The MIT License)

Copyright (c) 2008 Jamis Buck

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: about 11 hours ago

Total Commits: 1,253
Total Committers: 226
Avg Commits per committer: 5.544
Development Distribution Score (DDS): 0.704

Commits in past year: 19
Committers in past year: 5
Avg Commits per committer in past year: 3.8
Development Distribution Score (DDS) in past year: 0.263

Name Email Commits
Miklos Fazekas m****s@s****m 371
Jamis Buck j****s@3****m 198
delano d****o@s****m 138
Florian Wininger f****e@g****m 78
Anders Carling l****e@l****u 17
Nick Pezza p****a@h****m 14
Carl Hörberg c****g@g****m 12
Christopher Hunt c****t@g****m 11
Ryosuke Yamazaki r****i@m****m 10
Chris Aumann me@c****g 9
Harald Sitter s****r@k****g 9
NetSHH Robot r****t@n****o 9
jmutkawoa j****a@c****u 8
Seth Skousen s****n@m****m 7
Simon Chopin s****n@c****m 7
Musy Bite m****e@g****m 6
Akinori MUSHA k****u@i****g 6
Kimura Masayuki m****0@g****m 5
Jesse Sanford j****e@j****m 5
Christoph Lupprich c****h@l****h 5
Ben Schmeckpeper b****r@g****m 5
Andy Brody a****y@s****m 5
Akira Matsuda r****e@d****p 5
Marco Sandrini n****e@g****m 5
Ari Lerner a****r@c****m 5
Klaus Stein g****b@i****e 5
Javier Gonel b****c@g****m 4
Jared Beck j****d@j****m 4
GabKlein g****r@g****m 4
Steven Hazel s****h@a****g 4
and 196 more...

Committer domains:


Issue and Pull Request metadata

Last synced: 5 days ago

Total issues: 85
Total pull requests: 117
Average time to close issues: 12 months
Average time to close pull requests: 3 months
Total issue authors: 77
Total pull request authors: 58
Average comments per issue: 3.26
Average comments per pull request: 2.2
Merged pull request: 59
Bot issues: 0
Bot pull requests: 0

Past year issues: 7
Past year pull requests: 13
Past year average time to close issues: 16 days
Past year average time to close pull requests: 1 day
Past year issue authors: 7
Past year pull request authors: 6
Past year average comments per issue: 1.71
Past year average comments per pull request: 1.38
Past year merged pull request: 4
Past year bot issues: 0
Past year bot pull requests: 0

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/net-ssh/net-ssh

Top Issue Authors

  • voxik (4)
  • fwininger (4)
  • flux-johnm (2)
  • AhamedFayaz (2)
  • gdtrfb55 (1)
  • Kamori (1)
  • Antsiscool (1)
  • tom-horcrux (1)
  • j1wilmot (1)
  • Subramanian-ERS (1)
  • n-rodriguez (1)
  • Raighar (1)
  • qpdeploy (1)
  • jayjanssen (1)
  • twilley (1)

Top Pull Request Authors

  • mfazekas (15)
  • fwininger (11)
  • mikeatlas (6)
  • bschmeck (4)
  • zzambers (4)
  • junaruga (4)
  • mattbrictson (3)
  • usiegj00 (2)
  • terceiro (2)
  • marvinthepa (2)
  • kpumuk (2)
  • atharvaksh (2)
  • sztupy (2)
  • flux-benj (2)
  • srbarrios (2)

Top Issue Labels

  • help-wanted (7)
  • good-first-issue (6)
  • Needs: Author Feedback (3)
  • bug (3)

Top Pull Request Labels

  • Needs: Author Feedback (2)

Package metadata

gem.coop: net-ssh

Net::SSH: a pure-Ruby implementation of the SSH2 client protocol. It allows you to write programs that invoke and interact with processes on remote servers, via SSH2.

  • Homepage: https://github.com/net-ssh/net-ssh
  • Documentation: http://www.rubydoc.info/gems/net-ssh/
  • Licenses: MIT
  • Latest release: 7.3.0 (published about 1 year ago)
  • Last Synced: 2025-12-23T18:31:04.132Z (about 24 hours ago)
  • Versions: 156
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 344,733,290 Total
  • Docker Downloads: 896,084,726
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 0.043%
    • Downloads: 0.068%
    • Docker downloads count: 0.105%
  • Maintainers (3)
rubygems.org: net-ssh

Net::SSH: a pure-Ruby implementation of the SSH2 client protocol. It allows you to write programs that invoke and interact with processes on remote servers, via SSH2.

  • Homepage: https://github.com/net-ssh/net-ssh
  • Documentation: http://www.rubydoc.info/gems/net-ssh/
  • Licenses: MIT
  • Latest release: 7.3.0 (published about 1 year ago)
  • Last Synced: 2025-12-23T22:02:13.014Z (about 20 hours ago)
  • Versions: 156
  • Dependent Packages: 876
  • Dependent Repositories: 74,894
  • Downloads: 344,750,852 Total
  • Docker Downloads: 896,084,726
  • Rankings:
    • Dependent packages count: 0.054%
    • Downloads: 0.063%
    • Docker downloads count: 0.13%
    • Dependent repos count: 0.135%
    • Average: 0.599%
    • Forks count: 1.275%
    • Stargazers count: 1.937%
  • Maintainers (3)
proxy.golang.org: github.com/net-ssh/net-ssh

  • Homepage:
  • Documentation: https://pkg.go.dev/github.com/net-ssh/net-ssh#section-documentation
  • Licenses: mit
  • Latest release: v7.3.0+incompatible (published about 1 year ago)
  • Last Synced: 2025-12-22T14:03:08.243Z (2 days ago)
  • Versions: 81
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Forks count: 1.395%
    • Stargazers count: 2.076%
    • Average: 5.962%
    • Dependent packages count: 9.576%
    • Dependent repos count: 10.802%
gem.coop: net-ssh-net-ssh

Net::SSH: a pure-Ruby implementation of the SSH2 client protocol.

  • Homepage: http://github.com/net-ssh/net-ssh
  • Documentation: http://www.rubydoc.info/gems/net-ssh-net-ssh/
  • Licenses: mit
  • Latest release: 2.0.14 (published over 11 years ago)
  • Last Synced: 2025-12-22T14:03:05.831Z (2 days ago)
  • Versions: 3
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 8,836 Total
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 16.712%
    • Downloads: 50.136%
rubygems.org: net-ssh-net-ssh

Net::SSH: a pure-Ruby implementation of the SSH2 client protocol.

  • Homepage: http://github.com/net-ssh/net-ssh
  • Documentation: http://www.rubydoc.info/gems/net-ssh-net-ssh/
  • Licenses: mit
  • Latest release: 2.0.14 (published over 11 years ago)
  • Last Synced: 2025-12-22T14:03:03.021Z (2 days ago)
  • Versions: 3
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 8,836 Total
  • Rankings:
    • Forks count: 1.177%
    • Stargazers count: 1.772%
    • Dependent packages count: 15.706%
    • Average: 23.194%
    • Dependent repos count: 46.782%
    • Downloads: 50.53%
conda-forge.org: rb-net-ssh

  • Homepage: https://rubygems.org/gems/net-ssh
  • Licenses: MIT
  • Latest release: 6.1.0 (published over 5 years ago)
  • Last Synced: 2025-12-01T10:03:37.056Z (23 days ago)
  • Versions: 4
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Forks count: 7.407%
    • Stargazers count: 12.019%
    • Average: 26.157%
    • Dependent repos count: 34.025%
    • Dependent packages count: 51.175%
gem.coop: kjvarga-net-ssh

Net::SSH: a pure-Ruby implementation of the SSH2 client protocol.

  • Homepage: http://github.com/net-ssh/net-ssh
  • Documentation: http://www.rubydoc.info/gems/kjvarga-net-ssh/
  • Licenses: mit
  • Latest release: 2.0.12 (published over 11 years ago)
  • Last Synced: 2025-12-22T14:03:06.153Z (2 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 3,639 Total
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 27.182%
    • Downloads: 81.547%
rubygems.org: kjvarga-net-ssh

Net::SSH: a pure-Ruby implementation of the SSH2 client protocol.

  • Homepage: http://github.com/net-ssh/net-ssh
  • Documentation: http://www.rubydoc.info/gems/kjvarga-net-ssh/
  • Licenses: mit
  • Latest release: 2.0.12 (published over 11 years ago)
  • Last Synced: 2025-12-22T14:03:06.060Z (2 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 3,639 Total
  • Rankings:
    • Forks count: 1.177%
    • Stargazers count: 1.772%
    • Dependent packages count: 15.706%
    • Average: 29.533%
    • Dependent repos count: 46.782%
    • Downloads: 82.226%
rubygems.org: eximius-net-ssh

Net::SSH: a pure-Ruby implementation of the SSH2 client protocol. It allows you to write programs that invoke and interact with processes on remote servers, via SSH2.

  • Homepage: https://github.com/net-ssh/net-ssh
  • Documentation: http://www.rubydoc.info/gems/eximius-net-ssh/
  • Licenses: MIT
  • Latest release: 6.3.1 (published over 3 years ago)
  • Last Synced: 2025-12-22T14:03:05.236Z (2 days ago)
  • Versions: 1
  • Dependent Packages: 1
  • Dependent Repositories: 0
  • Downloads: 1,610 Total
  • Rankings:
    • Forks count: 1.227%
    • Stargazers count: 1.876%
    • Dependent packages count: 7.713%
    • Average: 31.125%
    • Dependent repos count: 46.779%
    • Downloads: 98.031%
  • Maintainers (1)
gem.coop: eximius-net-ssh

Net::SSH: a pure-Ruby implementation of the SSH2 client protocol. It allows you to write programs that invoke and interact with processes on remote servers, via SSH2.

  • Homepage: https://github.com/net-ssh/net-ssh
  • Documentation: http://www.rubydoc.info/gems/eximius-net-ssh/
  • Licenses: MIT
  • Latest release: 6.3.1 (published over 3 years ago)
  • Last Synced: 2025-12-22T14:03:05.510Z (2 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 1,610 Total
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 31.815%
    • Downloads: 95.446%
  • Maintainers (1)
gem.coop: net-ssh-clone

Net::SSH: a pure-Ruby implementation of the SSH2 client protocol. It allows you to write programs that invoke and interact with processes on remote servers, via SSH2.

  • Homepage: https://github.com/net-ssh/net-ssh
  • Documentation: http://www.rubydoc.info/gems/net-ssh-clone/
  • Licenses: MIT
  • Latest release: 7.0.1 (published about 3 years ago)
  • Last Synced: 2025-12-22T14:03:05.615Z (2 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 960 Total
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 32.415%
    • Downloads: 97.244%
  • Maintainers (1)
rubygems.org: net-ssh-clone

Net::SSH: a pure-Ruby implementation of the SSH2 client protocol. It allows you to write programs that invoke and interact with processes on remote servers, via SSH2.

  • Homepage: https://github.com/net-ssh/net-ssh
  • Documentation: http://www.rubydoc.info/gems/net-ssh-clone/
  • Licenses: MIT
  • Latest release: 7.0.1 (published about 3 years ago)
  • Last Synced: 2025-12-22T14:03:03.019Z (2 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 960 Total
  • Rankings:
    • Forks count: 1.227%
    • Stargazers count: 1.874%
    • Dependent packages count: 15.706%
    • Average: 32.965%
    • Dependent repos count: 46.779%
    • Downloads: 99.241%
  • Maintainers (1)
rubygems.org: net-ssh-backports

Net::SSH: a pure-Ruby implementation of the SSH2 client protocol. It allows you to write programs that invoke and interact with processes on remote servers, via SSH2.

  • Homepage:
  • Documentation: http://www.rubydoc.info/gems/net-ssh-backports/
  • Licenses: MIT
  • Latest release: 6.3.6.backports (published almost 2 years ago)
  • Last Synced: 2025-12-22T14:03:04.068Z (2 days ago)
  • Versions: 7
  • Dependent Packages: 1
  • Dependent Repositories: 0
  • Downloads: 3,817 Total
  • Rankings:
    • Dependent packages count: 15.74%
    • Dependent repos count: 48.83%
    • Average: 54.632%
    • Downloads: 99.325%
  • Maintainers (1)

Dependencies

Gemfile rubygems
  • codecov >= 0 development
  • simplecov >= 0 development
net-ssh.gemspec rubygems
  • bundler >= 1.17 development
  • ed25519 ~> 1.2 development
  • minitest ~> 5.10 development
  • mocha ~> 1.11.2 development
  • rake ~> 12.0 development
  • rubocop ~> 1.28.0 development
.github/workflows/ci-with-docker.yml actions
  • actions/checkout v3 composite
.github/workflows/ci.yml actions
  • actions/cache v1 composite
  • actions/checkout v3 composite
  • actions/setup-python v2 composite
  • ruby/setup-ruby v1 composite
.github/workflows/rubocop.yml actions
  • actions/checkout v3 composite
  • ruby/setup-ruby v1 composite
Dockerfile docker
  • ruby ${RUBY_VERSION} build

Score: 34.066686357152854