Every site or blogs tells you how to completely remove the password prompt for sudo commands.
I didn't came across a site that tells anything else.
This post will show, how you can prompt for passwords everytime for specific commands only.
This can be useful for passwording commands like
shutdown or similiar ones that could accidentally produce a worst case.
- sudo installed
- sudo access
- a noVNC console or an active root user with valid password in case something goes wrong.
First of create a file called
Then edit the file and add the following code into:
Cmd_Alias will store the commands you want passworded. You need to enter the full path of each.
You can add as many commands as you like. Seperate them with a comma and you're good to go.
If thats done, you can use any other sudo command without a password and the added commands in the file will ask you for a password.