-
Notifications
You must be signed in to change notification settings - Fork 932
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
182 additions
and
41 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# OS10 Configuration | ||
|
||
Disable banner/motd | ||
|
||
```text | ||
banner login disable | ||
banner motd disable | ||
``` | ||
|
||
Add allowed commands to privilege level 4 | ||
|
||
```text | ||
privilege exec priv-lvl 4 "show inventory" | ||
privilege exec priv-lvl 4 "show inventory media" | ||
privilege exec priv-lvl 4 "show running-configuration" | ||
``` | ||
|
||
Create the user will the role sysadmin (it will see the full config, including auth info and users) and the privilege level 4 | ||
|
||
```text | ||
username oxidized password verysecurepassword role sysadmin priv-lvl 4 | ||
``` | ||
|
||
The commands Oxidized executes are: | ||
|
||
1. terminal length 0 | ||
2. show inventory | ||
3. show inventory media | ||
4. show running-configuration | ||
|
||
Oxidized can now retrieve your configuration! | ||
|
||
Back to [Model-Notes](README.md) |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
class NecIX < Oxidized::Model | ||
prompt /^(\([\w.-]*\)\s[#$]|^\S+[$#]\s?)$/ | ||
comment '! ' | ||
expect /^--More--$/ do |data, re| | ||
send ' ' | ||
data.sub re, '' | ||
end | ||
|
||
cmd 'show running-config' do |cfg| | ||
cfg = cfg.each_line.to_a[3..-2].join | ||
cfg.gsub! /^.*Current time.*$/, '' | ||
cfg | ||
end | ||
|
||
cfg :telnet do | ||
username /^Username:/ | ||
password /^Password:/ | ||
end | ||
|
||
cfg :telnet, :ssh do | ||
post_login do | ||
send "configure\n" | ||
end | ||
|
||
pre_logout do | ||
send "\cZ" | ||
send "exit\n" | ||
end | ||
end | ||
end |
Oops, something went wrong.