0

I have a similar issue as the prior one Net::SSH with non unix/linux host?

I am trying to connect to a device (vyatta) and do some configurations. If I use exec, it will raise an exception like "invalid command". I guess that is because the environment issue. What I am looking for is a way to just send a string to server to simulate the manual way, I thought send_data could do it, but seems like not works. Any suggestions? Thanks

@ssh_conn = Net::SSH.start( host, user, :password => pass ) do |ssh|
 ssh.open_channel do |channel|
   p "open channel"
  channel.send_data("show date\n")
 end
 end

Paste another useful link here, seems vyatta uses vbash Paramiko "Invalid command" when trying non-standard command for Vyatta

3
  • Can you connect to the device at all with plain old ssh (on command line)? It might help if you say what device you are talking about. Commented Sep 22, 2014 at 10:35
  • stackoverflow.com/questions/15864552/… the device is vyatta, seems I found another clue in the link I pasted, it is using vbash. So the question is how can I run the command in vbash env with net::ssh Commented Sep 22, 2014 at 11:13
  • I gave up to use expect shell as a work around, do not want to spend a lot of time on the vbash compatibility. But it is still welcome if anyone can provide a solution Commented Sep 23, 2014 at 6:32

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.