ronibastos
(usa Outra)
Enviado em 19/04/2024 - 23:36h
Consegui a solução ideal para esse problema no forum do github com a ajuda de "
Wesley Schwengle", segue abaixo a mensagem dele, funcionou pra mim!
You can use this boilerplate. I allow users in the sudoers group to do safe operations without a password. There is a potentially unsafe bit with dist-upgrades (full-upgrades), but since I feel my people have knowledge, I also allow this to be passwordless. Anything else requires a password. Feel free to change it to your liking.
# Place this in a file in /etc/sudoers.d/002-apt
#
# Allow apt to run without sudo password for some common operations
Cmd_Alias APT_UPDATE = /usr/bin/aptitude update, /usr/bin/apt-get update, /usr/bin/apt update, /usr/bin/apt-file update
Cmd_Alias APT_UPGRADE = /usr/bin/aptitude safe-upgrade, /usr/bin/apt-get upgrade, /usr/bin/apt upgrade, /usr/bin/aptitude safe-upgrade --no-new-installs
# These are potentially removing things, but are generally safe and needed for upgrades
Cmd_Alias APT_DUPGRADE = /usr/bin/aptitude full-upgrade, /usr/bin/apt-get dist-upgrade, /usr/bin/apt full-upgrade
Cmd_Alias APT_CLEAN = /usr/bin/aptitude clean, /usr/bin/apt-get clean, /usr/bin/apt clean
Cmd_Alias APT_AUTOCLEAN = /usr/bin/aptitude autoclean, /usr/bin/apt-get autoclean, /usr/bin/apt autoclean
Cmd_Alias APT_AUTOREMOVE = /usr/bin/aptitude autoremove, /usr/bin/apt-get autoremove, /usr/bin/apt autoremove
%sudo ALL=(ALL:ALL) NOPASSWD: APT_UPDATE
%sudo ALL=(ALL:ALL) NOPASSWD: APT_UPGRADE
%sudo ALL=(ALL:ALL) NOPASSWD: APT_DUPGRADE
%sudo ALL=(ALL:ALL) NOPASSWD: APT_CLEAN
%sudo ALL=(ALL:ALL) NOPASSWD: APT_AUTOCLEAN
%sudo ALL=(ALL:ALL) NOPASSWD: APT_AUTOREMOVE