libssh
libssh
LibSSH implementation in Crystal Lang to execute Cisco commands
Configure the user account with privilege level 15 (full access) to be able to login directly into enabled mode
Switch> enable
Switch# configure terminal
Switch(config)# username YOURUSERNAME privilege 15 secret YOURPASSWORD
Installation
RedHat
sudo yum install libssh-devel
Debian / Ubuntu
sudo apt install libssh-dev
MAC OS
brew install libssh
- Add the dependency to your
shard.yml
:
dependencies:
libssh:
github: xtokio/libssh
- Run
shards install
Usage
require "libssh"
ssh = LibSSH.new("example.com","user","password")
# Execute command
response = ssh.execute_command("show running-config interface gi1/0/1")
puts response
# Execute command in config mode
response ssh.execute_config_command(["do show running-config interface gi1/0/1"])
puts response
# Create VLAN
ssh.execute_config_command(["vlan 10","name vlan10"])
# Remove VLAN
ssh.execute_config_command(["no vlan 10"])
Contributing
- Fork it (https://github.com/xtokio/libssh/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Contributors
- Luis Gomez - creator and maintainer
Repository
libssh
Owner
Statistic
- 0
- 0
- 0
- 0
- 0
- 17 days ago
- July 11, 2024
License
MIT License
Links
Synced at
Sat, 23 Aug 2025 04:09:18 GMT
Languages