As for port forwarding the ssh(22), telnet(23) port, I receive the 'connection refused' through linux console. The video shows exactly as what I tried, although opening ports for gaming purpose is not what I'm doing. I've had this problem with earlier belkin model such as F7D4302 model as I was unable to accomplish that as well. Instead, the accepted alternative to Telnet's lack of security is Secure Shell (SSH). Learn how to configure SSH on your Cisco router. David Davis has the details.
The VTY lines look normal
line vty 0 4
session-timeout 40
exec-timeout 40
password 7 xxxxxxxxxxxx
transport input ssh
I also have this:
service tcp-keepalives-in
service tcp-keepalives-out
service timestamps debug datetime msec
service timestamps log datetime msec
service password-encryption
no service password-recovery
Anything I should be checking for when I get into the console?
- I will check if the certificate is present
- If there are hung sessions
Anything else I could check to verify? There is no acl's on the vty lines as you can see, not sure what else to look for.
thank you
I am trying to write a script where I need to ssh multiple jump server to access a router.
e.g LocalMachine----ssh---server1---ssh---server2---telnet/ssh---router
Not sure what is the best way of doing it, i tried achieving it through pexpect.My requirement is when i telnet from server server2 to router and it timeout/connection refused i want try sshany suggestions please?
1 Answer
The pexpect.TIMEOUT
exception would be raised by the program instance running on your machine. It does not know if there is a timeout for the telnet
instance running on the remote machine that you have ssh'ed to. The only way you can see if the telnet connection has a timeout or similar error, ie. connection refused, is to look at the output from the the process through pexpect
. If you look at the documentation for expect
it says that you can give a list of conditions - this could be one way to go.
For example: