11-23-2020 01:55 PM
Hi!
I'm trying to login into a switch which is connected through a terminal server vis ssh.
When i login nothing happens and after a while i get
TypeError: device is not connected, output must be provided.
When i try with ssh "ssh -p 4002 username@10.10.10.2" login works but i need to press enter at least once before the switch prompt gets displayed.
My testbed file looks like:
testbed: credentials: default: username: '%ASK{}' password: '%ASK{}' devices: SW1: connections: console: protocol: ssh ip: 10.10.10.2 port: 4002 os: 'ios' type: switch platform: '2960'
What can i do to trigger the switch so that it prints a login prompt after supplying the password?
I read about 'execute' and 'command' but i have no clue how to extend my testbed file.
Solved! Go to Solution.
11-24-2020 04:49 AM
Somehow i figured it out!
testbed: credentials: default: username: '%ASK{}' password: '%ASK{}' devices: SW1: connections: console: protocol: ssh ip: 10.10.10.2 port: 4002 arguments: connection_timeout : 2 prompt_recovery : true os: 'ios' type: switch platform: '2960'
Using arguments: and prompt_recovery.
With those settings in the testbed.yaml it tries to recover the prompt after 2 seconds (default is 60).
Would be nice if someone knows how to set the connection_timeout only for login and reset it afterwards.
11-24-2020 04:49 AM
Somehow i figured it out!
testbed: credentials: default: username: '%ASK{}' password: '%ASK{}' devices: SW1: connections: console: protocol: ssh ip: 10.10.10.2 port: 4002 arguments: connection_timeout : 2 prompt_recovery : true os: 'ios' type: switch platform: '2960'
Using arguments: and prompt_recovery.
With those settings in the testbed.yaml it tries to recover the prompt after 2 seconds (default is 60).
Would be nice if someone knows how to set the connection_timeout only for login and reset it afterwards.
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: