GNS3 / gns3-server

GNS3 server
GNU General Public License v3.0
767 stars 258 forks source link

Support SSH for console connections, not just telnet #2181

Open rb83 opened 1 year ago

rb83 commented 1 year ago

As the subject says. Generally a good practice, and it would also enable easier deployment of shared instances.

josephmhiggins commented 1 year ago

Which VM supports an ssh console connection and GNS3 does not support such a connection? ...This gets complicated quickly because for "easier deployment" you want all you VMs that you distribute to be ssh enabled, but some VMs do not yet support such a thing natively. There are people on github working on adding an extra iso to a VM to enable SSH so that VMs can be easily deployed with ssh enabled....but I have not tested their efforts yet, e.g. Windows Server 2019.

rb83 commented 1 year ago

I'm really not sure what you're trying to say. It is quite sufficient to provide the ability to switch to SSH for server deployments on Linux, and keeping telnet the default for others.

Today our GNS3 server installs allocate telnet-speaking TCP ports on the host for each device, connecting their virtual serial port to it. It is my understanding that this is done all in python. Hence, it shouldn't be too complicated to switch these ports to talking SSH, since there is a python-native implementation of the protocol.

josephmhiggins commented 1 year ago

gns3 is a graphic network simulator. i believe there is no vm that exists in the world that supports ssh natively on its console interface. gns3 should not simulate something that does not exist. consequently, it is your responsibility to configure an interface on the vm to support ssh.

grossmj commented 1 year ago

Thanks for the idea, I have already identified a potential Python package that we could use to implement this: https://asyncssh.readthedocs.io/en/latest/

rb83 commented 1 year ago

@grossmj If you'd like, you can point me towards where the console/tcp plumbing takes place, I could prep a PR. I have some minor preliminary experience with paramiko and async python. Would need to eval asyncssh vs. paramiko though. On first glance, asyncssh seems easier in this usecase, as paramiko understands itself to be a much more low-level library.

mepholic commented 1 month ago

gns3 is a graphic network simulator. i believe there is no vm that exists in the world that supports ssh natively on its console interface. gns3 should not simulate something that does not exist. consequently, it is your responsibility to configure an interface on the vm to support ssh.

Not everybody using GNS3 is 100% tied to VMs. I have 2 physical Cisco Catalyst 4503E's in my GNS3 topology, and I am using "Cloud" devices to attach passed through physical NICs to connect said switches into the topology. I would still like to retain the ability to double click the cloud icons in the GNS3 GUI to launch a console, and this is currently possible by modifying the console settings under the "Misc." tab in the node configuration. See the attached screenshot: image

Avocent/Vertiv and Cyclades make serial console devices that currently allow telnet and SSH access to attached console devices. I've got my two Cat4503's attached to an Avocent console server, and would prefer to use SSH over telnet for security purposes; our cybersecurity policy also requires using encrypted management protocols like SSH over telnet where possible. Obviously, this is not currently possible due to the lack of SSH console support in GNS3. This feature is definitely useful in the real world, and desirable for many.

Here's further evidence of this fact from the serial console server: image