M
M
MARMELAD032016-07-24 13:54:24
linux
MARMELAD03, 2016-07-24 13:54:24

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

5 answer(s)
Y
yalex1442, 2016-07-24
@MARMELAD03

gksudo [-u <user>] [options] <command>
Create shortcuts with above command for needed programs

C
CityCat4, 2016-07-25
@CityCat4

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.

A
Alexander, 2016-07-24
@NeiroNx

I don't know about you, but I do sudo su - or su - if I need to do something as root.

S
subvillion, 2016-07-25
@subvillion

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'

A
Alexander, 2016-07-25
@2gud

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

A launch shortcut should appear in the menu.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question