Answer the question
In order to leave comments, you need to log in
How to make programs that require root automatically ask for his password?
It is not convenient to run programs from the terminal that require root. How to make programs automatically ask for a password?
Answer the question
In order to leave comments, you need to log in
gksudo [-u <user>] [options] <command>
Create shortcuts with above command for needed programs
If it is inconvenient from the terminal, then there is graphics. There are graphics, so you can create shortcuts on the desktop. And in the shortcut, you can specify that the program is running from another user.
I don't know about you, but I do sudo su - or su - if I need to do something as root.
No way. Programs don't require sudo, they don't know about it, they require the privileges that sudo gives, like listen port < 1000. In order for programs to understand that they don't have enough rights, you need to either change the program code or wrap the program in a gksudo/sudo wrapper. The easiest way to do this is through alias in .bashrc eg.alias nmap='sudo nmap'
gksudo xterm
gksu xterm
Create a file in ~/.local/share/applications/bla-bla.desktop with something like this.
[Desktop Entry]
Name=Root Terminal
Comment=Opens a terminal as the root user, using gksu to ask for the password
Encoding=UTF-8
Exec=gksudo -l gnome-terminal
Icon=gksu-root-terminal
StartupNotify=true
Terminal=false
X-MultipleArgs=false
Type=Application
Categories=GTK;Utility;TerminalEmulator;
TryExec=gnome-terminal
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question