setting DEHYDRATED_USER does not check uid first #425

Closed
opened 2025-12-29 01:24:58 +01:00 by adam · 0 comments
Owner

Originally created by @jmgurney on GitHub (Aug 20, 2019).

If you set DEHYDRATED_USER (to prevent accidentally running as root), it checks to make sure sudo is available before verifying the current user. If you have a system w/o sudo, instead of running, it errors out:

# INFO: Using main config file /usr/local/etc/dehydrated/config
ERROR: DEHYDRATED_USER set but sudo not available. Please install sudo.
gold,pts,/usr/local/etc/dehydrated,6$id
uid=443(_letsencrypt) gid=443(_letsencrypt) groups=443(_letsencrypt)
gold,pts,/usr/local/etc/dehydrated,7$grep DEHYDRATED_USER /usr/local/etc/dehydrated/config
DEHYDRATED_USER=_letsencrypt

expected behavior: That when the script is running as the specified DEHYDRATED_USER (and _GROUP), and sudo is not installed, that the script will run as expected.

Originally created by @jmgurney on GitHub (Aug 20, 2019). If you set DEHYDRATED_USER (to prevent accidentally running as root), it checks to make sure sudo is available before verifying the current user. If you have a system w/o sudo, instead of running, it errors out: ```gold,pts,/usr/local/etc/dehydrated,5$/usr/local/bin/dehydrated -c # INFO: Using main config file /usr/local/etc/dehydrated/config ERROR: DEHYDRATED_USER set but sudo not available. Please install sudo. gold,pts,/usr/local/etc/dehydrated,6$id uid=443(_letsencrypt) gid=443(_letsencrypt) groups=443(_letsencrypt) gold,pts,/usr/local/etc/dehydrated,7$grep DEHYDRATED_USER /usr/local/etc/dehydrated/config DEHYDRATED_USER=_letsencrypt ``` expected behavior: That when the script is running as the specified DEHYDRATED_USER (and _GROUP), and sudo is not installed, that the script will run as expected.
adam added the bug label 2025-12-29 01:24:58 +01:00
adam closed this issue 2025-12-29 01:24:58 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/dehydrated#425