How to fix 'sudo: no tty present and no askpass program specified' error?

前端 未结 26 1633
失恋的感觉
失恋的感觉 2020-11-22 03:36

I am trying to compile some sources using a makefile. In the makefile there is a bunch of commands that need to be ran as sudo.

When I compile the sour

26条回答
  •  北恋
    北恋 (楼主)
    2020-11-22 04:18

    Make sure the command you're sudoing is part of your PATH.

    If you have a single (or multi, but not ALL) command sudoers entry, you'll get the sudo: no tty present and no askpass program specified when the command is not part of your path (and the full path is not specified).

    You can fix it by either adding the command to your PATH or invoking it with an absolute path, i.e.

    sudo /usr/sbin/ipset

    Instead of

    sudo ipset

提交回复
热议问题