This forum has been archived. All content is frozen. Please use KDE Discuss instead.

howto: run konsole as root

Tags: konsole konsole konsole
(comma "," separated)
elibenyaacov
Registered Member
Posts
5
Karma
0
OS

howto: run konsole as root

Mon Oct 18, 2010 12:57 pm
hello,

I want to create a desktop shortcut to konsole which will run as root. I enter the properties of the shortcut and in the application->advance I click 'run as' and enter root as the username.

the problem is that even though konsole runs as root (and immediately asks me for the password), all the environment is set as my regular user. how can I tell kde to run this shortcut completely as root (something like the - in the su command)?

thanks.

OS: fedora 13, kde 4.4.5
User avatar
isadora
Registered Member
Posts
70
Karma
0
OS

Re: howto: run konsole as root

Mon Oct 18, 2010 1:05 pm
Create "New link to application" on your desktop.
Under "Application"->"Command", fill out: kdesu konsole
Works for me.


..............bird from paradise..............
elibenyaacov
Registered Member
Posts
5
Karma
0
OS

Re: howto: run konsole as root

Mon Oct 18, 2010 1:19 pm
isadora wrote:Create "New link to application" on your desktop.
Under "Application"->"Command", fill out: kdesu konsole
Works for me.


thanks, but still not working. all the environment variables (like USER, LOGNAME and KDESU_USER) are set to the normal user (not root).

is it not the same for you?
User avatar
google01103
Manager
Posts
6668
Karma
25

Re: howto: run konsole as root

Mon Oct 18, 2010 1:58 pm
instead of run as user root with command = konsole use "kdesu konsole" as the application command


OpenSuse Leap 42.1 x64, Plasma 5.x

elibenyaacov
Registered Member
Posts
5
Karma
0
OS

Re: howto: run konsole as root

Mon Oct 18, 2010 2:19 pm
google01103 wrote:instead of run as user root with command = konsole use "kdesu konsole" as the application command


that's what I did :(
User avatar
google01103
Manager
Posts
6668
Karma
25

Re: howto: run konsole as root

Mon Oct 18, 2010 2:42 pm
elibenyaacov wrote:
isadora wrote:Create "New link to application" on your desktop.
Under "Application"->"Command", fill out: kdesu konsole
Works for me.


thanks, but still not working. all the environment variables (like USER, LOGNAME and KDESU_USER) are set to the normal user (not root).

is it not the same for you?


yes, but fonts, theme, colors, home, KDEHOME are root's

note: QT_PLUGIN_PATH, GTK2_RC_FILES, GS_LIB, MAIL and LOGNAME are also still the normal user's

Not knowing exactly what you are trying to accomplish it might be that what you need to do is open a remote shell to your computer as root or open a remote X session so that all env variables are root's


OpenSuse Leap 42.1 x64, Plasma 5.x

User avatar
isadora
Registered Member
Posts
70
Karma
0
OS

Re: howto: run konsole as root

Mon Oct 18, 2010 2:43 pm
elibenyaacov wrote:
isadora wrote:Create "New link to application" on your desktop.
Under "Application"->"Command", fill out: kdesu konsole
Works for me.


thanks, but still not working. all the environment variables (like USER, LOGNAME and KDESU_USER) are set to the normal user (not root).

is it not the same for you?


It is working here, like expected, so in root-prompt.


..............bird from paradise..............
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: howto: run konsole as root

Tue Oct 19, 2010 2:29 am
Running Konsole as root is not needed. Add a shell to Konsole ( Settings > Manage Profile ) and set the shell to "/bin/bash -c 'su -'"


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
elibenyaacov
Registered Member
Posts
5
Karma
0
OS

Re: howto: run konsole as root

Tue Oct 19, 2010 8:15 am
google01103 wrote:Not knowing exactly what you are trying to accomplish it might be that what you need to do is open a remote shell to your computer as root or open a remote X session so that all env variables are root's


Instead of opening a normal konsole and writing 'su -' to go root I was just trying to make a shortcut which will start as root. was a bit lazy I guess... ;)

bcooksley wrote:Running Konsole as root is not needed. Add a shell to Konsole ( Settings > Manage Profile ) and set the shell to "/bin/bash -c 'su -'"


thanks, that's working well enough.
cutter101
Registered Member
Posts
1
Karma
0

Re: howto: run konsole as root

Thu Jan 10, 2013 5:31 pm
I saw same problem when I tried to create an application launcher on the panel to run gnome-terminal.
First what didn't work: (fails to give root his proper $PATH and environment)
kdesu -c gnome-terminal
and what I found to work:
kdesu -c "/bin/bash --login -c gnome-terminal"

should work in your case or other applications that need more proper of an environment.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: howto: run konsole as root

Thu Feb 07, 2013 10:19 am
As previously mentioned, it is possible to simply get Konsole to execute a root shell, which ensures that Konsole itself remains part of your session.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
[Moviuro]
Registered Member
Posts
86
Karma
0
OS

Re: howto: run konsole as root

Mon Feb 11, 2013 10:02 pm
Put as command for your shortcut:
Code: Select all
konsole -e "su -"

The Konsole should then open on "Password:" and wait for input.


KDE 4.10.1 Archlinux x86_64 on both laptops :)
"Our life is the immortals' death"
luttztfz
Registered Member
Posts
6
Karma
0
OS
According to https://userbase.kde.org/Konsole you would just make a new profile, e.g. call it “root konsole”, and set the command “/bin/su -” as its shell. Done. Now all you need to select is a new “root konsole” from a running Konsole, or start the Konsole with this profile (“konsole --profile <name>”)…
oldmanriver
Registered Member
Posts
28
Karma
0

Re: howto: run konsole as root

Thu Jan 23, 2020 6:53 pm
All.

I'm attepting the opening of Konsole with 3-4 ""Sudo mode" tab sessions and have written my issues up at:

https://www.linuxquestions.org/question ... ost6082123

And would appreciate any help; in finishing my BASH script to do this!

Cheers!

TBNK
oldmanriver
Registered Member
Posts
28
Karma
0

Re: howto: run konsole as root

Thu Jan 23, 2020 8:09 pm
oldmanriver wrote:All.

I'm attepting the opening of Konsole with 3-4 ""Sudo mode" tab sessions and have written my issues up at:

https://www.linuxquestions.org/question ... ost6082123

And would appreciate any help; in finishing my BASH script to do this!

Cheers!

TBNK

All,

Some progress on this as 3 tabs correctly open with correct working dirs, but still not getting to "SUDO" mode on these!

Update posting in the writeup link!

Cheers!

TBNK


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], kesang, Yahoo [Bot]