3

I want to set askpass program for sudo, i've made file /etc/sudoers.d/path-askpass with following content:

# Path to askpass program 

Path askpass /usr/bin/ssh-askpass

File was edit with visudo, which complains on syntax error at line 3, whereas i can't see any syntax errors there.

sudo version:

~$LANG=C sudo -V
Sudo version 1.8.10p3
Sudoers policy plugin version 1.8.10p3
Sudoers file grammar version 43
Sudoers I/O plugin version 1.8.10p3

2 Answers 2

1

You forgot the =. Try this way:

Path askpass = /usr/bin/ssh-askpass
2
  • 2
    Thanks, that fixed my problem, but in man sudo.conf there is no = char.
    – Pavlus
    Commented Dec 10, 2014 at 19:24
  • Hmmm... I tried this, but when I then used 'sudo -A systemctl status sshd', sudo complained that it could not find ' = /usr/bin/ssh-askpass'... which makes sense, as '=' shouldn't be part of the name of the executable. Commented May 4, 2022 at 11:49
0

It's 2022, and for people reading that they should add '=', you might try not adding this, and ignoring the error message. But maybe do this in a safe way:

  1. In another terminal, sudo su to have root access so you can recover if anything goes wrong.
  2. Within visudo, save without the =, tapping 'Q' to ignore the warning and save the file anyway.
  3. From the non-root terminal, try sudo -A systemctl status sshd or somesuch.

If your requested askpass executable works, great... you're done. Otherwise, maybe try the = approach, or figure out if your askpass path is wrong, or whatever you feel is appropriate to resolve the problem.

For me, ignoring the warning worked. There's apparently a bug somewhere in visudo that doesn't quite get this line right, at least in my environment.

If sudo just won't start anymore after your change, use the root session established in step 1 to revert the file.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .