Created
October 30, 2025 21:13
-
-
Save dginhoux/24f18317bae5534e9fbd0a05f61a7c69 to your computer and use it in GitHub Desktop.
full desktop computer sudoers.d with cmd alias
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # keep env | |
| Defaults:dginhoux env_keep += "PATH HOME USER LOGNAME LANG TERM" | |
| Defaults:dginhoux env_keep += "SSH_AUTH_SOCK" | |
| Defaults:dginhoux env_keep += "XDG_RUNTIME_DIR" | |
| Defaults:dginhoux env_keep += "HTTP_PROXY HTTPS_PROXY NO_PROXY" | |
| Defaults:dginhoux env_keep += "http_proxy https_proxy no_proxy" | |
| # proxy | |
| Cmnd_Alias PROFILE_PROXY = \ | |
| /usr/bin/tee /etc/profile.d/http-proxy.sh, \ | |
| /usr/bin/rm -v /etc/profile.d/http-proxy.sh | |
| Cmnd_Alias APT_PROXY = \ | |
| /usr/bin/tee /etc/apt/apt.conf.d/proxy.conf, \ | |
| /usr/bin/rm -v /etc/apt/apt.conf.d/proxy.conf | |
| Cmnd_Alias DOCKER_PROXY = \ | |
| /usr/bin/mkdir -p /etc/systemd/system/docker.service.d, \ | |
| /usr/bin/tee /etc/systemd/system/docker.service.d/http-proxy.conf, \ | |
| /usr/bin/rm -v /etc/systemd/system/docker.service.d/http-proxy.conf | |
| Cmnd_Alias SNAP_PROXY = \ | |
| /usr/bin/snap set system proxy*, \ | |
| /usr/bin/snap get system proxy*, \ | |
| /usr/bin/snap unset system proxy* | |
| # systemctl | |
| Cmnd_Alias SYSTEMCTL_DAEMON = /usr/bin/systemctl daemon-reload | |
| Cmnd_Alias SYSTEMCTL_UNITS = \ | |
| /usr/bin/systemctl * docker.service, \ | |
| /usr/bin/systemctl * containerd.service, \ | |
| /usr/bin/systemctl * pcscd.service, \ | |
| /usr/bin/systemctl * idocachesrv.service, \ | |
| /usr/bin/systemctl * safenetauthenticationclient.service, \ | |
| /usr/bin/systemctl * strongswan.service, \ | |
| /usr/bin/systemctl * strongswan-starter.service | |
| # strongswan | |
| Cmnd_Alias SWAN = \ | |
| /usr/sbin/swanctl *, \ | |
| /usr/bin/tee /etc/strongswan.d/charon/pkcs11.conf, \ | |
| /usr/bin/tee /etc/strongswan.d/charon/resolve.conf, \ | |
| /usr/bin/tee /etc/swanctl/conf.d/edcs_ecureuil.conf, \ | |
| /usr/bin/rm -v /etc/swanctl/conf.d/edcs_ecureuil.conf | |
| # tools | |
| Cmnd_Alias MINICOM = \ | |
| /usr/bin/minicom | |
| Cmnd_Alias NMCLI = \ | |
| /usr/bin/nmcli * | |
| Cmnd_Alias DOCKER = \ | |
| /usr/bin/docker *, \ | |
| /usr/bin/podman * | |
| Cmnd_Alias NETTOOLS = \ | |
| /usr/bin/nc *, \ | |
| /usr/bin/tcpdump * | |
| Cmnd_Alias PKG = \ | |
| /usr/bin/apt *, \ | |
| /usr/bin/snap *, \ | |
| /usr/bin/flatpak * | |
| Cmnd_Alias MAINLINE = \ | |
| /usr/bin/mainline *, \ | |
| /usr/bin/mainline-gtk * | |
| # Grant NOPASSWD for the aliases | |
| dginhoux ALL = (ALL:ALL) NOPASSWD: \ | |
| PROFILE_PROXY, \ | |
| APT_PROXY, \ | |
| DOCKER_PROXY, \ | |
| SNAP_PROXY, \ | |
| SYSTEMCTL_UNITS, \ | |
| SYSTEMCTL_DAEMON, \ | |
| SWAN, \ | |
| MINICOM, \ | |
| NMCLI, \ | |
| DOCKER, \ | |
| NETTOOLS, \ | |
| PKG, \ | |
| MAINLINE | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment