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

前端 未结 26 1646
失恋的感觉
失恋的感觉 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:16

    No one told what could cause this error, in case of migration from one host to another, remember about checking hostname in sudoers file:

    So this is my /etc/sudoers config

    User_Alias      POWERUSER = user_name
    Cmnd_Alias SKILL = /root/bin/sudo_auth_wrapper.sh
    POWERUSER hostname=(root:root) NOPASSWD: SKILL
    

    if it doesn't match

    uname -a
    Linux other_hostname 3.10.17 #1 SMP Wed Oct 23 16:28:33 CDT 2013 x86_64 Intel(R) Core(TM) i3-4130T CPU @ 2.90GHz GenuineIntel GNU/Linux
    

    it will pop up this error:

    no tty present and no askpass program specified

提交回复
热议问题