Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6732811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:41:40+00:00 2026-05-26T10:41:40+00:00

I am trying to use the Net::SSH library to login and manage a host

  • 0

I am trying to use the Net::SSH library to login and manage a host that supports ssh. It is a piece of telecom equipment and so speaks TL1. I seem to be able to log in successfully, but when I try to ssh.exec something, it aborts saying it could not execute command. Here is my simple code:

require 'net/ssh'

Net::SSH.start('10.204.121.192', 'password', :password => "password") do |ssh|
  ssh.exec("INH-MSG-ALL;")
end

If i point the same code at a Linux server and provide a command such as “ls -l /”, it works fine. What I am wondering is, can I use this ssh library? Do I need to use another command instead of exec?

This is the error output:

/usr/local/rvm/gems/ruby-1.9.2-p290/gems/net-ssh-2.2.1/lib/net/ssh/connection/session.rb:322:in `block (2 levels) in exec': could not execute command: "INH-MSG-ALL;" (RuntimeError)
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/net-ssh-2.2.1/lib/net/ssh/connection/channel.rb:597:in `call'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/net-ssh-2.2.1/lib/net/ssh/connection/channel.rb:597:in `do_failure'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/net-ssh-2.2.1/lib/net/ssh/connection/session.rb:586:in `channel_failure'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/net-ssh-2.2.1/lib/net/ssh/connection/session.rb:456:in `dispatch_incoming_packets'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/net-ssh-2.2.1/lib/net/ssh/connection/session.rb:213:in `preprocess'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/net-ssh-2.2.1/lib/net/ssh/connection/session.rb:197:in `process'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/net-ssh-2.2.1/lib/net/ssh/connection/session.rb:161:in `block in loop'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/net-ssh-2.2.1/lib/net/ssh/connection/session.rb:161:in `loop'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/net-ssh-2.2.1/lib/net/ssh/connection/session.rb:161:in `loop'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/net-ssh-2.2.1/lib/net/ssh/connection/session.rb:110:in `close'
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/net-ssh-2.2.1/lib/net/ssh.rb:194:in `start'
from ssh_test.rb:3:in `<main>'
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T10:41:41+00:00Added an answer on May 26, 2026 at 10:41 am

    I assume it works fine when you login in the shell manually.

    To understand what is the difference when you connect through net/ssh collect output of env command in both cases and compare.

    That most probably you’ll see a difference that will lead you to a solution or at least will give you dirty trick.

    UPDATE. (Not working)

    Net::SSH.start('10.204.121.192', 'password', :password => "password") do |ssh|
       ssh.open_channel do |channel|
            channel.on_data do |ch, data|
              puts "got data: #{data.inspect}"
            end
            channel.send_data("INH-MSG-ALL;\n")
       end
    end
    

    UPDATE2. (Working)

    Net::SSH.start('10.204.121.192', 'password', :password => "password") do |ssh|
       ssh.open_channel do |channel|
            channel.send_channel_request "shell"
            channel.on_data do |ch, data|
              puts "got data: #{data.inspect}"
            end
            channel.send_data("INH-MSG-ALL;\n")
       end
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I've been trying to use the Net::SSH::Multi to login to multiple machines using
Im trying to use ASP.NET login controls, in a ASP.NET MVC project and i
I'm trying to use the .net API library to get a single image by
I'm trying to use Net::SSH::Perl to connect using public keys with this code: my
I'm trying to use .NET HttpListener in a C# project. When I register my
I am trying to use net user with c# System.Diagnostics.ProcessStartInfo proccessStartInfo = new System.Diagnostics.ProcessStartInfo(net
I'm trying to use TestDriven.Net not only to test my code, but to call
I'm trying to use a .NET assembly from VB6 via interop without placing it
I am trying to use ASP.NET Server Controls (ASP.TextBox etc) with MVC (to take
I'm trying to use ASP.net profiles I've followed some instructions which means I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.