Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for non passwordless sudo (offering my contribution) #451

Open
aspacca opened this issue Feb 20, 2025 · 0 comments
Open

Support for non passwordless sudo (offering my contribution) #451

aspacca opened this issue Feb 20, 2025 · 0 comments

Comments

@aspacca
Copy link

aspacca commented Feb 20, 2025

What do you want?

Support for non passwordless sudo

Why do you want this?

Because sudo with no password it's against the principles of security first

Recommended solution

  1. give the ability to launch sudo with -S flag
       -S, --stdin
               Write the prompt to the standard error and read the password from the standard input instead of using
               the terminal device.
  1. give the ability to launch sudo with -A flag and specify SUDO_ASKPASS environment variable
       -A, --askpass
               Normally, if sudo requires a password, it will read it from the user's terminal.  If the -A (askpass)
               option is specified, a (possibly graphical) helper program is executed to read the user's password and
               output the password to the standard output.  If the SUDO_ASKPASS environment variable is set, it
               specifies the path to the helper program.  Otherwise, if sudo.conf(5) contains a line specifying the
               askpass program, that value will be used.  For example:

                   # Path to askpass helper program
                   Path askpass /usr/X11R6/bin/ssh-askpass

               If no askpass program is available, sudo will exit with an error.

       SUDO_ASKPASS     Specifies the path to a helper program used to read the password if no terminal is available
                        or if the -A option is specified

Additional context

Please, consider this as my offer to contribute with a PR for adding the feature. I've added the two alternative recommended solutions as the only two I'm aware of. Glad to consider other options and to implement all the ones that you consider acceptable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant