SSH to a server and exit Python script (in the same shell) -
i'm running script that's determining login information me, , in end outputting login information need use.
i running script in terminal, , want ssh me credentials has, exit python script on computer , connect current terminal new server.
say have sshhost, sshuser , sshpass variables in script. how run ssh command in current terminal , connect server?
i tried subprocess , spur, didn't manage going.
i appreciate , in advance.
assuming python prints settings stdout;
#!/bin/sh export $(credentials.py) exec ssh hostname
Comments
Post a Comment