I am connecting to a device that doesn't use the standard Linux shell initially. I need to open it to be able to write commands on the remote machine. This can be done by writing the command shell then provide Username and Password as they are requested one after another. Then I will be connected to the shell and be able to write my commands.
What is a good way to do this? having tried something like bellow doesn't seem to be working very well.
13 cr_shell = ssh_client.invoke_shell()
14 time.sleep(2)
15 cr_shell.send("shell\n")
16 time.sleep(2)
17 cr_shell.send("usrname\n")
18 time.sleep(.5)
19 cr_shell.send("pass\n")
20 time.sleep(.5)
21 cr_shell.send("ls ..\n")
22 output = branch_shell.recv(99999)
23 print (output)