Coder Social home page Coder Social logo

Comments (5)

Neilpang avatar Neilpang commented on May 19, 2024

What error do you see ?

from acme.sh.

drscriptt avatar drscriptt commented on May 19, 2024

I see the following in my cron job output:

sudo: no tty present and no askpass program specified

Note: I don't receive such errors when running interactively.

I receive multiple (5) security alerts from sudo:

FQDN : Feb 13 22:40:01 : USER : a password is required ; TTY=unknown ; PWD=/working/path ; USER=root ; COMMAND=/usr/bin/uptime

I followed the flow of a "renew" through the code and see no need for sudo to be used for a renewal. In fact, when I searched for sudo in the code, the only two places I see reference to it is the test in _initpath() and the routine that creates the cron job.

So, I don't understand why sudo is included at all, especially when there is a comment that it's not require

from acme.sh.

Neilpang avatar Neilpang commented on May 19, 2024

just fixed. "sudo" is removed from the crontab.

"Not required to be root" doesn't mean "Not be root in any cases". for example, If you use standalone mode to issue cert, when the crontab tries to re-issue the cert , it must be root to be able to listen to 80 port.

Your machine just seems not quite normal: the root user is required to input password when using sudo.

In most normal cases, the password is not required for root user to use sudo.

Yes, this issue maybe a problem for a normal sudoer, who is required to input password. That's why I removed 'sodu' from crontab.

I think normal sudoers should use other approaches to get rid of the issue above.

from acme.sh.

drscriptt avatar drscriptt commented on May 19, 2024

Is sudo still part of the _initpath() function?

You seem to be assuming that I'm running the cron job as root. That is a false assumption. I'm not running the cron job as root. I'm running the cron job as my unprivileged user.

Many distrobutions may allow root to run sudo, some even with NOPASSWD: However, assuming ~> expecting that to be the case is very dangerous. Many ~> most enterprise environments will abandon the defaults with prejudice. (I know of a top 100 consulting company that just finished a company wide security audit / cleanup effort for thousands of their client companies restricting sudo like I'm describing.)

Even if root is allowed to run sudo -and- do so with NOPASSWD:, there is an EXTREMELY good chance that sudo is configured to 'requiretty'. So, unless someone goes WAY out of their way to generate a bogus tty (something that is not trivial to do), non-interactive jobs (like cron) won't have a tty. Thus they can't satisfy the 'requiretty' parameter.

from acme.sh.

heldchen avatar heldchen commented on May 19, 2024

@drscriptt see f9a1b64

from acme.sh.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.