Created
August 13, 2017 00:28
-
-
Save elcontrastador/b32325801969b13ab59289d721acfff5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Problem: Basically the switch authenticates but doesn't actually put me in edit mode...the error I get with the subsequent 'show' command is the output from typing 'show' in view (non-edit) mode. Thoughts? | |
### bin/swcut.rb | |
require 'net/ssh' | |
Net::SSH.start('172.22.142.1','myuser', password: 'mypass') do |ssh| | |
ssh.exec!('edit') | |
puts ssh.exec!('show') | |
end | |
### output start ### | |
Tylers-MacBook-Pro-3:voip tyler$ ruby bin/swcut.rb | |
error: syntax error, expecting <command>: show | |
Tylers-MacBook-Pro-3:voip tyler$ | |
### output end ### | |
### from ssh interactive ### | |
> ssh [email protected] | |
[email protected]'s password: <mypass> | |
--- JUNOS 12.3R12.4 built 2016-01-20 04:27:28 UTC | |
{master:0} | |
[email protected]> <type 'edit'> | |
Entering configuration mode | |
Users currently editing the configuration: | |
oneif terminal p3 (pid 99909) on since 2017-08-12 15:07:06 GMT+8, idle 01:06:56 | |
{master:0}[edit system services dhcp] | |
{master:0}[edit] | |
[email protected]# <type 'show'> | |
## Last changed: 2017-08-12 15:50:43 GMT+8 | |
version 12.3R12.4; | |
system { | |
host-name dist1.tr200.hh; | |
time-zone GMT+8; | |
root-authentication { | |
. | |
. | |
. lots... | |
### end from ssh interactive ### |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment