I am trying to run commands as sudo over SSH, without success:
ssh -t -p 2222 name@server /usr/bin/sudo << EOF chmod u-r /xy chmod +x /xy /xy sleep 5 ps aux | grep xy sleep 5 exit EOF This is not working. Without -t and /usr/bin/sudo:
sudo: no tty present and no askpass program specified Single line command is working:
ssh -p 13001 -t name@server 'sudo /xy'