I'm trying to create command which is doing "ssh -> sudo su -> auto type password to sudo -> I have bash running under root"
I run this command ssh -t myuser@host "echo 'myuserPassword' | /usr/bin/sudo -S /bin/bash -l"
I want it result in login as root and keep bash running. But instead I'm getting error:
stdin: is not a tty
Please how to fix this error and make it work?
Or any other way to auto login with sudo password?
Thanks.