konsole --profile "root shell"

It’s not often that I use it but I’m pretty sure that the last time I looked at the entry in KMenuEdit (probably a year or so ago) the command to open the Terminal in “Super User Mode” was something like “su konsole”. It seems that it has now been changed (I can only assume, as part of an update) to ‘konsole --profile “root shell”’ - but this doesn’t work!

I have fiddled about with it a bit and can get the “bouncing red screen” to appear, but, no further.

I’m not too worried. I can still run “su” + Passwd in the Konsole - I just wondered if anyone knew anything?

dmk

Hi
I would guess creating a menu entry (desktop file) using kdesu would do the trick. It’s also better to use su - rather than su as su keeps user environment variables.


su
echo $USER
env
exit
su -
echo $USER
env
exit

Strange. On this 13.2 system the “Super User Mode” Konsole Version 2.14.2 under KDE 4.14.9 also uses ‘konsole --profile “Root Shell”’ in the KDE Menu. The only issue I have is that typing ‘konsole --profile “Root Shell”’ in a normal user’s Konsole window’s CLI creates a new Konsole window but, with the “normal” user’s CLI – not that of root. Starting the “Super User Mode” Konsole from the KDE Menu results in a Konsole Window asking for the root user’s password.
[HR][/HR]If you open a “normal” user’s Konsole window and check in “Settings” –> “administrate Profiles” (or something similar - I only have a German language session open); there should be two profiles in there: a “standard” user profile and, a “root” profile. If the “root” profile is missing, create it.

The parameter connected to --profile is a name that points to a profile in Konsole’s configuration.

This is 13.1, but I assume there is not much difference with 13.2.
When, from a Konsole window, I use Settings > managing profiles, you will se the profiles you have. One of the profiles I have is “Root”. When I Edit that to see it’s setting, it contains the Profile name: Root and the Command: su -. There are more settings there (I use them to give a different background to this Profile).

I also have the profile "Root Shell. It’s comando is also su -. I assume you are now able to check for yourself what you have. There are some differences with the Root profile though (but I do not use this profile). Either change the menu entry to use profile Root (when you have it), or adapt the profile “Root Shell” when that is broken (not to your liking).

Remember that the command given there is the command that is executed as first command in the shell of the started Konsole session. It is NOT the command konsole is started with, that is in the menu data.

@thebigming: Please check the following in your ~/.kde4/share/ directories:

  • In “~/.kde4/share/apps/konsole/” there should be at least two files: “Shell.profile” and “Root Shell.profile” {with a space in the file name}.
  • In “~/.kde4/share/config/” check the konsolerc; it should be something like this:

$Version]
update_info=konsole.upd:2.9.0-global-options

[Desktop Entry]
DefaultProfile=Shell.profile

[Favorite Profiles]
Favorites=Root Shell.profile

[KonsoleWindow]
ShowWindowTitleOnTitleBar=true

[MainWindow]
Height 1080=896
State=AAAA/wAAAAD9AAAAAAAAA2EAAANsAAAABAAAAAQAAAAIAAAACPwAAAAA
ToolBarsMovable=Disabled
Width 1920=865

[TabBar]
ShowQuickButtons=true

What you could try, is to logout from the KDE4 Plasma session; from a Virtual Terminal (tty0/1/2/3/4/5/6) login with you user name; delete “konsolerc” and the profiles in the “apps/konsole/” directory; log back in to a KDE4 Plasma session; bring up a Konsole Terminal window to recreate the configuration files; close the Konsole window and then re-open it ans set-up the standard and ‘root’ user profiles.

It would appear that on Jun 27, thebigming did say:

> It’s not often that I use it but I’m pretty sure that the last time I
> looked at the entry in KMenuEdit (probably a year or so ago) the command
> for to open the Terminal in “Super User Mode” was something like “su
> konsole”. It seems that it has now been changed (I can only assume, as
> part of an update) to ‘konsole --profile “root shell”’ - but this
> doesn’t work!
>
> I have fiddled about with it a bit and can get the “bouncing red screen”
> to appear, but, no further.
>
> I’m not too worried. I can still run “su” + Passwd in the Konsole - I
> just wondered if anyone knew anything?

Well I don’t use kde. But I do use konsole. And from an openbox session I type into
any run box or xterm the same string I embed in interactive scripts and have a
keybinding set to. Though in my case I also embed a call to midnight commander.


konsole -e su -
konsole -e su - -c mc

Either way, when konsole opens it’s got an embedded password prompt that I must
answer correctly or the konsole instance terminates. After I type in the correct
password I get the root prompt I set in root’s .bashrc.

For interactive scripts and/or keybindings I use a konsole profile with a distinctively
different background that I don’t use for anything else. Which helps me avoid mistaking
it for an ordinary konsole instance. For similar reasons I used root’s mc settings to
change the panel colors of root’s mc sessions:


JtWdyP

To all - Cor! I never realised that “su” had so many ramifications.

In my own defence, I started using Linux during the last century. I pretty
quickly settled on SuSE + KDE, dropped the Terminal icon onto the Panel & ran
“su” when I needed it; I only used the “Super User Mode” button 1 time in 100
(or, more probably, 1 in 1,000). I knew nothing about “su -”, “kdesu” nor
anything else.

The solution I have settled on (for the moment) is:

$(kde4-config --path libexec)kdesu -c konsole

which (thanks Martin) seems to work fine (as long as I remember to un-check the
“Remember Password” box) BUT there are other interesting things. There is the
comment made by Henk about “profiles” for “Root” of which I’m, sort of, on top
and some (apparently) useful stuff from dcurtisfra about files which I haven’t
explored as yet - but will. I am also grateful to** jwdyp **- his reply arrived too
late last night (I was already tucked up in bed with Mrs. dmk & my mug of
Horlicks) but it does raise some interesting issues.

Meanwhile, I remembered that there was a “Super User” mode for Dolphin (which,
apparently, doesn’t work either):

dbus-launch dolphin %i -caption "%c" "%u"

So, I thought, let’s try this and see what happens:

dbus-launch konsole %i -caption "%c" "%u"

I hit “Enter” and all the lights went out - not only here in my house, the
entire village (and several others, around & about) lost power. Ooer? Don’t
try this at home kids!

When I’ve sorted all this out, I’ll stick an end-note in to discover what I’ve
worked out. Meanwhile, thanks to you all for your help.

dmk

PS: I don’t think it was me who brought the circuit down - an old factory site in the
village is being converted to residential property & (apparently) someone cut a cable - but who knows?

In the 1900’s the default method of dealing with KDE on UNIX® issues was to delete everything that looked or smelled like a configuration file, logout and then login again – KDE recreated the environment; we usually didn’t have access to Virtual Terminals.
[HR][/HR]If I understand you correctly, you were in bed with the Missus and a mug of Horlicks and somehow you had a hand free to mess about on a keyboard – and then the lights went out …Man oh man: that’s world-class multitasking !!! >:)

Well! This has been a trial by fire & broken glass in no mistake.

In the beginning, I had a collection profiles & colourschemes created when I
first started using KDE 16/17 or so years ago (at a time when I knew Fall about
what I was doing) but I have kept & used them ever since. Looking at the old
configuration text files, one of the things I discovered was that colorschemes
(say, MyCrazyColours) ended up in the profile for “End-of-the-World” (neither of
those actually existed).

SO! This is a complete idiots guide to repairing the Konsole!

I decided I needed a profile for a “Normal” (non “SuperUser”) Konsole &
also “SuperUser” - both of which (using the aged material I had) I then
created. I now have only 2 entries in:

/home/<username>/kde4/share/apps/konsole

and they are:

  1. MyProfile
  2. RootToot

This means that I can (from within the “normal” mode) use “su” or “su -” to
create “SuperUser” authority and then switch the mode of the Konsole to the
Red Screen” (RootToot) to remind me I’m in dangerous territory and, when I
exit, I must switch back to MyProfile (Blue Screen)

BUT, That’s not the end! I still after bringing the entire electricity network of SE
England to it’s knees:smile:, in an attempt to get the “SuperUser” button to work, I had
to get the button to work.

  1. Go to the root directory
  2. Goto .kde4/share/apps/konsole/ (ie: /root/.kde4/share/apps/konsole)
  3. Copy** RootToot.profile** + RootToot.colorscheme (or whatever), from:

/home/<username>/.kde4/share/apps/konsole/RootToot.*
To
/root/.kde4/share/apps/konsole/

  1. &, I renamed “RootToot” as “RootShell” in this instance - It’s not
    necessary, the files are the same, but it comforts me. However
  2. TO DO this, you must change the titles of the “profile” &
    colorscheme” files from <oldname> to <newname> **AND
    **6) Edit the “profile” file to replace every instance of <oldname> with
    <newname> - there should be at least 2 instances, maybe more

Finally, my original problem had been that the::

konsole --profile “root shell”

command which appeared in KMenuEditor had simply not worked, drcurtisfra
(above) reports a slightly similar phenomenon but at least his SuperUser button
did the “right thing”, mine didn’t. Martin Lewis suggested kdesu, I worked out

$(kde4-config --path libexec)kdesu -c konsole

& entered that into the KMenuEditor “Command” line - and this, pretty much,
works - but not entirely.

I’m working on it.

My thanks, as always’ to my respondents & I hope someone will find these
ramblings of some help in the future.

dmk

Unfortunately, there’s been a dramatic and major change to KDE since the changes made to support Qt4: Plasma.
This has resulted in some major changes in the way that Profiles and Colour Schemes are handled; an addition is “Designs” . . .

  • The bottom line is: importing archived Profiles and Colour Schemes from “old-timer” KDE versions to the “brave new” Plasma world, is not a trivial task

Curiously, AFAIK “KDE4 Plasma” and “KDE Plasma 5” both function wonderfully in the antipodean countries of Planet Earth.

@dcurtusfra

Dammit! it was all so much easier with CPM!

I’m now struggling with “su”, “sudo” & “su -”. I’ll drop you the link when I sort out what (I think) I’m doing.

Thanks as usual.

dmk

PS. Although I was flattered by your admiration for my capacity at multitasking; Mrs dmk & I are both over 70 - the mug of Horlicks should have given it away!

dmk

DEC RT-11 was also quite simple; from what I saw of IBM DOS running on a PDP-11/50, that wasn’t quite so simple; RSX-11M was somewhat more complex as was RSX-11M+ and RSTS/E; VAX/VMS raised the barrier once more; UNIX® (in the BSD and DEC-Ultrix flavours) was in the early days maybe a little bit simpler than VAX/VMS but on the other hand “more difficult” due to the system documentation available then.The largest complexity I was aware of then, was the IBM System Programming world: a bookcase 8 metres long and 3 metres high was just about capable of holding the documentation set supplied by IBM.

If you’re used to UNIX® and the system privileges model then, “su” & Co. shouldn’t be too difficult.

Take a look at my profile: I do not attempt to obfuscate my age.