Simple, small, fast, concurrent SSH server to emulate network equipment (i.e. Cisco IOS) for testing purposes.
Download the latest release from GitHub Releases and run:
./cisshgogo run cissh.gogo build -o cisshgo cissh.go
./cisshgoPull and run the latest release:
docker run -d -p 10000-10049:10000-10049 ghcr.io/tbotnz/cisshgo:latestOr run with custom options:
docker run -d -p 10000:10000 ghcr.io/tbotnz/cisshgo:latest -listeners 1 -startingPort 10000Or build locally:
docker build -t cisshgo .
docker run -d -p 10000-10049:10000-10049 cisshgoBuild a local snapshot release:
goreleaser release --snapshot --clean --skip=publishReleases are automated via GitHub Actions. To create a new release:
-
Create and push a tag:
git tag v0.1.2 git push origin v0.1.2
-
GitHub Actions will automatically:
- Build binaries for all platforms (linux/darwin/windows, amd64/arm64)
- Create multi-arch Docker images and push to Docker Hub
- Generate SBOMs for security compliance
- Create GitHub Release with binaries, archives, and checksums
- Build deb/rpm packages
The following secrets must be configured in the GitHub repository:
DOCKER_USERNAME- Docker Hub usernameDOCKER_PASSWORD- Docker Hub token/password
SSH into any of the open ports with admin as the password:
ssh -p 10000 admin@localhostDefault password: admin
test_device#show version
Cisco IOS XE Software, Version 16.04.01
Cisco IOS Software [Everest], CSR1000V Software (X86_64_LINUX_IOSD-UNIVERSALK9-M), Version 16.4.1, RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2016 by Cisco Systems, Inc.
Compiled Sun 27-Nov-16 13:02 by mcpre
...
ROM: IOS-XE ROMMON
Available commands:
show versionshow ip interface briefshow running-config
Additional commands can be added by modifying transcripts/transcript_map.yaml.
-listeners int
How many listeners do you wish to spawn? (default 50)
-startingPort int
What port do you want to start at? (default 10000)
-transcriptMap string
What file contains the map of commands to transcribed output? (default "transcripts/transcript_map.yaml")
./cisshgo -listeners 1 -startingPort 10000cisshgo is built with modularity in mind to support easy expansion or customization.
Transcripts support Go templating. For example, in show_version.txt:
ROM: IOS-XE ROMMON
{{.Hostname}} uptime is 4 hours, 55 minutes
Uptime for this control processor is 4 hours, 56 minutes
Available template variables from fakedevices.FakeDevice:
type FakeDevice struct {
Vendor string // Vendor of this fake device
Platform string // Platform of this fake device
Hostname string // Hostname of the fake device
Password string // Password of the fake device
SupportedCommands SupportedCommands // What commands this fake device supports
ContextSearch map[string]string // The available CLI prompt/contexts on this fake device
ContextHierarchy map[string]string // The hierarchy of the available contexts
}- Create a plain text file in the appropriate
vendor/platformfolder - Add an entry in
transcripts/transcript_map.yaml:
---
platforms:
- csr1000v:
command_transcripts:
"my new fancy command": "transcripts/cisco/csr1000v/my_new_fancy_command.txt"Supply additional device types and transcripts in transcript_map.yaml.
This works for devices with similar interaction patterns (e.g., configure terminal leading to (config)# mode).
NOTE: This feature is not fully implemented yet!
For platforms with different interaction patterns (e.g., Juniper, F5):
- Implement a new handler module under
ssh_server/handlers - Add it to the device mapping in
cissh.go
The handler controls SSH session emulation and provides conditional logic to simulate the device experience.
MIT License - see LICENSE file for details.
Cisco IOS is the property/trademark of Cisco.