I was in need of a script to perform certain actions remotely using python and paramiko. I performed sudo operations in remote machine using
'echo '+password+' | sudo -S '+'cmd_to_be_executed'
and tty issue was solved by setting the flag get_pty as true in paramiko. Now there is a remote machine which does not have sudo permission for that user, only way to switch to root is by using su command. So I tried
'echo '+password+' | su -c '+'cmd_to_be_executed'
but it throws tty issue. Now even if I, set pty flag as true in paramiko the same issue appears
standard in must be a tty
Is there any way to solve this ? Any help is much appreciated thanks!!!