https://unix.stackexchange.com/questions/276474/how-can-i-execute-any-command-as-a-normal-user-without-sudo
Add these to the end of /etc/sudoers
USERNAME HOST_NAME = (root) NOPASSWD: /usr/bin/apt-get USERNAME HOST_NAME = (root) NOPASSWD: /usr/bin/shutdown
Add these to your ~/.bashrc
alias shutdown='sudo shutdown' alias apt-get='sudo apt-get'
Reload the startup config for the current session.
$ source ~/.bashrc
Now you can run the commands as a normal user without being prompted for a root/sudo password (and therefore, eliminate the need to know the password altogether).
$ apt-get update $ apt-get upgrade $ shutdown -h now
No hay comentarios.:
Publicar un comentario