YaST2 GUI looks easier than it’s command line version, but some command lines have to run in terminal with root privilege, for inputting password string one less time, how can I run root commands from the GUI (usually YaST2) which already have root privilege?
but some command lines have to run in terminal with root privilege,
So login with
su -l
And when you use KDE, there is from the main menu > System > Terminal - Super User Mode, which will start Konsole for you with already a
su -l
thus the only thing to do is entering the root password.
People say that running GUI with root privilege is not advised.
You are, of course, NOT running the GUI as root!
You are starting a terminal emulator (like xterm or konsole), in the normal user’s GUI. In that terminal emulator runs a shell (mostly bash) and it is there that the
sudo -l
is done.
Thus only that shell process is running “as root” (and everything you start from it). NOT the GUI.
A little off the subject but this is the third time I’ve seen the recommended use of su with the -l parameter. Man shows - and -l and --login as the same. Why the extra keystroke?
Bart
Because some people like it. You can choose to your style (I use only -, because that is already doing it’s job since ~40 years).
I re-read your post and conclude that I did interpret it wrong.
The answer is that YaST does not have a shell escape, thus you must run your commands from a terminal emulator, or from the real console.
English is not my 1st 2nd 3rd language, it is nice of you to read and think about it.
Well, in fact it was my fault. As said I did not read your post careful enough. When re-reading it, it does say what you wanted to ask in clear English :).
And yes, sometimes I also have open two things: YaST and (using KDE) Terminal in Super User Mode. And yes, that is two times typing the root password. But it is only two times ;). And it does not happen very often.