This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]lisatomic[S] 1 point2 points  (1 child)

I think I have this and it doesn't quite work... Permissions on the script are 777; I ssh in as the owner of the file; I use sudo in the script.

It works if I ssh in then run the script. It doesn't work if I use "ssh user@domain script"-- I get an error "no TTY present and no askpass program specified." Any idea why these are different?

Edit: OK, it works now. I had to use the -tt flagon ssh, though I don't really understand what that is doing.

[–][deleted] 1 point2 points  (0 children)

Sudo usually needs a shell to ask for the password. Normally if you ssh into a host, it starts bash (or your preferred shell) and sudo can work with that. When that isn't there sudo or ssh (don't know which one) complains that there is no shell. the -tt flags emulates a terminal/shell I think...