Remove dependency on sudo? #347

Closed
opened 2025-12-29 01:23:29 +01:00 by adam · 2 comments
Owner

Originally created by @tovine on GitHub (May 16, 2018).

I noticed that dehydrated refuses to run without sudo installed if DEHYDRATED_USER is set - why is that?
The same feature (restarting the script as a different user) is also perfectly doable using the su command: su $DEHYDRATED_USER -s /bin/bash -c "${0} ${ORIGARGS}"; the only difference I can see immediately is the option to explicitly specify the group to run as.

While sudo may be more feature-complete in some respects, su is "guaranteed" to be present in mostly any system you would run on and IMO should at least be provided as a fallback if sudo is not found.

I can probably make a PR for it if you want me to.

Originally created by @tovine on GitHub (May 16, 2018). I noticed that dehydrated refuses to run without `sudo` installed if `DEHYDRATED_USER` is set - why is that? The same feature (restarting the script as a different user) is also perfectly doable using the `su` command: `su $DEHYDRATED_USER -s /bin/bash -c "${0} ${ORIGARGS}"`; the only difference I can see immediately is the option to explicitly specify the group to run as. While `sudo` may be more feature-complete in some respects, `su` is "guaranteed" to be present in mostly any system you would run on and IMO should at least be provided as a fallback if `sudo` is not found. I can probably make a PR for it if you want me to.
adam closed this issue 2025-12-29 01:23:29 +01:00
Author
Owner

@lukas2511 commented on GitHub (May 22, 2018):

Using sudo does allow for a user switch without the need for a password (if configured). Also the group option might be needed by some people. Nobody forces you to use the dehydrated integrated sudo operation, you could always just use su yourself.

@lukas2511 commented on GitHub (May 22, 2018): Using sudo does allow for a user switch without the need for a password (if configured). Also the group option might be needed by some people. Nobody forces you to use the dehydrated integrated sudo operation, you could always just use `su` yourself.
Author
Owner

@Mischelle89 commented on GitHub (May 22, 2018):

go
Using sudo does allow for a user switch without the need for a password (if configured). Also the group option might be needed by some people. Nobody forces you to use the dehydrated integrated sudo operation, you could always just use su yourself.

@Mischelle89 commented on GitHub (May 22, 2018): go Using sudo does allow for a user switch without the need for a password (if configured). Also the group option might be needed by some people. Nobody forces you to use the dehydrated integrated sudo operation, you could always just use su yourself.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/dehydrated#347