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

sudo only when required #35

Open
HaleTom opened this issue Jun 23, 2018 · 3 comments
Open

sudo only when required #35

HaleTom opened this issue Jun 23, 2018 · 3 comments

Comments

@HaleTom
Copy link

HaleTom commented Jun 23, 2018

Currently I need to run pacmatic as root.

Would you consider using sudo to perform only the required actions with elevated permissions?

AUR helpers (specified in $pacman_program) generally expect to be run as a non-root user, which is what prompted me to raise this issue.

@HaleTom
Copy link
Author

HaleTom commented Jun 23, 2018

I'm currently working around this by:

# Downgrade permissions as AUR helpers expect to be run as a non-root user
alias aurman='pacman_program="sudo -u #$UID /usr/bin/aurman" pacmatic'

# pacmatic needs to be run as root
alias pacmatic='sudo --preserve-env=pacman_program /usr/bin/pacmatic'

For more, see SE U&L question: Have pacmatic wrap aurman/pakku/pacaur/yaourt wrap powerpill wrap pacman

@HaleTom HaleTom changed the title Run AUR helper $pacman_program as non-root user sudo only when required Jun 23, 2018
@G4Zz0L1
Copy link

G4Zz0L1 commented Apr 25, 2020

Using those aliases (with yay on aurman) asks for the sudo password 2 times and I can't figure why. You know how to prevent it?

@HaleTom
Copy link
Author

HaleTom commented Apr 27, 2020

@G4Zz0L1 There are 2 sudo invocations there.

Google about for "how to sudo without password" for no password, or "sudo remember password" if you only want to type the password once.

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

2 participants