My problem is about executing sudo over SSH. I have tried various things, but non works.
Here is my script:
ssh my-host /bin/bash << EOF # some commands... sudo -u my-user -s -- << EOFF # other commands... EOFF EOF
Like that, I get
sudo: no tty present and no askpass program specified
So I tried with option -t for ssh
ssh -t my-host /bin/bash << EOF
Still get the same message. So I tried with double -t -t:
ssh -t -t my-host /bin/bash << EOF
Now I get to the password prompt, except I can see my password as I type it and pressing enter has no effect.
Additional constraint: I have limited rights on my-host. I cannot sudo, except to become user my-user.
Any idea? Thanks in advance