KDE konsole runs su - instead of bash

One of several users has a puzzling problem with konsole: opening a new tab in the konsole window results in invocation of “su -” instead of “bash”. All other users are not affected. Any idea?

Hi Karl,

Not sure, but in KDE starter there’s an entry for “Terminal in Super User Modus” and it refers to konsole as:

konsole --profile "Root Shell"

In ~/.config/konsolerc there’s an entry which here is

DefaultProfile=Profile 1.profile


Anything wrong in there?

kasi

Found nothing wrong there. KRunner shows konsole both in section Applications and in section Konsole-Profiles. The broken entry is “Applications > Konsole Terminal”. “Konsole-Profiles > Konsole: Shell” works normal.

Checked konsole > Settings > Configure Konsole > Profiles. “Root Shell” was default. Switching default to “Shell” was accepted, but would automatically revert to “Root Shell” upon quitting and starting again.>:(
Removed .local/share/konsole/Shell.profile and copied from a working user to .local/share/konsole/Profil 1.profile. Configured again and selected “Profil 1.profile” as default. This setting now persists.

So solved, but still a bit of a riddle. :frowning:

Very strange indeed.

@karlmistelberger:

Karl, before you ditched the user’s ‘~/.local/share/konsole/Root Shell.profile’, did you compare it to ‘/usr/share/konsole/Root Shell.profile’ ?

  • I have one major change in the user’s version of this file –
Command=/usr/bin/su --login

The system default is:

Command=su -

[HR][/HR]Please do not ask why I change the default value – the reasons why, have been discussed often enough …

Happens to me too, on both my computers.
On the desktop, I simply changed the default profile back to Shell.profile, and it stuck.
On the laptop, I cannot make it stick.
I’ll try to do as suggested by Karl.

Cris

I do not have a ~/.local/share/.konsole/Root Shell.profile

Cris

It is however, a reliable solution …

The only real issue I have with the system wide “Root Shell” profile located in ‘/usr/share/konsole/’, is the parameter of the “Command=” syntax …

In my system:

henk@boven:/usr/share/konsole> cat Root\ Shell.profile 
[General]
Command=su -
Icon=utilities-terminal_su
Name=Root Shell
Parent=FALLBACK/

[Appearance]
ColorScheme=BlackOnWhite
Font=Monospace,8,-1,2,50,0,0,0,0,0

[Scrolling]
ScrollMode=FixedLineCount
ScrollLineCount=1000
henk@boven:/usr/share/konsole>

I have only a command, no parameter in it??? Maybe a left-over from older installations?
In other words, what do you have there that you do not like.

  • “Command=su -

I have an extreme aversion to using shorthand commands in scripts and configuration files –

  • Therefore, I tend to prefer to use – “Command=/usr/bin/su --login
    ” …

Ok, I now understand you. No real change in what it does.

I found the problem on my pc that I was able to change and make it stick.
In the file ~/.config/konsolerc it had the following 2 lines:

[Desktop Entry]
DefaultProfile=Shell.profile

[Favorite Profiles]
Favorites=Shell.profile


After copying Profile 1.profile from another pc to the folder ~/.local/share/konsole I changed those lines to this:

[Desktop Entry]
DefaultProfile=Profile 1.profile

[Favorite Profiles]
Favorites=Profile 1.profile


This gave me the regular konsole back.

Ok, related to this… when using the dolphin file manager, I like to often hit F4 in order to quickly open a small konsole associated with the open folder. However, with this bug in the system it is opening the Konsole as root user and requiring a password. Where do we configure the Konsole thing that is associated with the Dolphin file manager? I want it to go back to operating as a regular user.

I’m not seeing this issue but, I only have the following Konsole profiles –


 > LANG=C l .local/share/konsole/
total 12
drwxr-xr-x  2 xxx users   53 Dec 27 12:08 ./
drwx------ 89 xxx users 4096 Jan 14 10:48 ../
-rw-------  1 xxx users  531 Aug 21  2020 Root Shell.profile
-rw-------  1 xxx users  527 Jul 16 16:29 Shell.profile
 > 

  • With nothing special contained in them – apart from my preference to use a fully qualified “su” command for the “Root Shell” profile …

Please check the Dolphin short-cuts –

  • F4
    should be assigned to “Terminal” – standard – default. - Shift-F4
    should be assigned to “Open Terminal”– standard – default. - Ctrl-Shift-F4
    should be assigned to “Focus Terminal Panel”– standard – default – the focus is either moved away from or, moved to, the panel opened at the bottom of the Dolphin window.

Ok, thanks… my shortcuts seem to all be in order, not sure why dolphin is still doing the small terminal as root. Although, when I hit shift-F4, it opens up a regular konsole window in that directory, not as root.

Interestingly, my directory structure doesn’t have “Root Shell” as an option on the profile page:

~/.local/share/konsole> ls -l
total 12
-rw------- 1 george users 1058 Jan 13 14:35 BlackOnWhite.colorscheme
-rw------- 1 george users  123 Jan 14 10:24 Profile 1.profile
-rw------- 1 george users  247 Jan 13 14:35 Shell.profile


DefaultProfile can be unset:

**erlangen:~ #** grep Default /home/tester/.config/konsolerc  
**Default**Profile= 
**erlangen:~ #**

Folder ~/.local/share/konsole can be empty:

[FONT=monospace]**erlangen:~ #** ll /home/tester/.local/share/konsole/          
total 0 
**erlangen:~ #**
[/FONT]

Users may start with empty folder and DefaultProfile being unset. They will get default behavior and may switch between Default[Read-only] and RootShell. They may add profiles and set default.

If the GUI causes trouble close all instances of konsole and clear DefaultProfile by editing konsolerc.