optikfluffel
optikfluffel

Reputation: 2748

sudo: no tty present and no askpass program specified

I tried jake together with launch a little but when I want to deploy my node.js app I get this during the process:

$ ssh mydomain.com sudo stop site.WebApp-production && sudo start site.WebApp-production
sudo: no tty present and no askpass program specified

✘  Failed to restart site

jake aborted.
Error
  at fail (/usr/local/lib/node_modules/jake/lib/api.js:235:13)
  at /Users/udo/Projects/WebApp/Jakefile.coffee:31:16
  at ChildProcess.exports.remote (/Users/udo/Projects/WebApp/node_modules/launch/lib/action.js:39:5)
  at ChildProcess.EventEmitter.emit (events.js:91:17)
  at Process._handle.onexit (child_process.js:674:10)

Do you know how to get rid of this? I'm using Debian 6 on my remote machine.

Thanks

Upvotes: 2

Views: 4726

Answers (2)

Garth Kidd
Garth Kidd

Reputation: 7504

Try ssh -t, which forces TTY allocation when running a command. That's good enough for sudo, at least on my Mac when trying to SSH commands into my Ubuntu boxen.

Upvotes: 3

Sjoerd
Sjoerd

Reputation: 75659

ssh <host> <command> tries to run the command on the host without any interaction. In your case, sudo needs a password, which it can't get because it is not an interactive session. If you really want this, configure sudo to accept you without asking for a password.

Edit: also, ssh <host> <command1> && <command2> will run command2 on the local machine, not on the remote machine.

Upvotes: 0

Related Questions