Kubuntu 21.04 - How to get terminal back from root to username?
UbuntuThis forum is for the discussion of Ubuntu Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Kubuntu 21.04 - How to get terminal back from root to username?
Usually, I open the terminal with CTRL+ALT+T.
Then, the prompt says:
Code:
username@computername:~#
But after I opened a folder (doesn't matter, which one) with root privileges, even after that folder is closed again, I get the following prompt, when opening the terminal with the above keyboard shortcut.
Code:
root@computername:/#
How can I get back to the ordinary one automatically, after the folder, opened with root privileges, is closed and without rebooting, please?
@ GentleThotSeaMonkey
Here's what I did:
I booted into Kubuntu in the ordinary way and also logged in there with my ordinary username and the according password. It's btw. a single user system, so there's only me there.
When I did it the first time, I couldn't find a context option to "open a folder as root". I found that option in the settings of Dolphin, within the new services of Dolphin (as a download) and added that option accordingly. As a result the missing option was present, now.
Then I opened a root folder (*) using this added option. But each time I'm doing this, the terminal always opens with the root prompt, as mentioned above. So far, the only way to fix this is by rebooting Kubuntu.
(*) Rem.: I need this mainly during the configuration of a newly installed distro, to fix for example the launcher of the Easystroke tool (in /usr/share/applications), because I have to remove a switch there at the end of the Exec line to let Easystroke start minimized to tray, i.e. without showing its configuration window.
EDIT:
To reproduce this, do the following:
Hit CTRL+ALT+T to verify that the terminal is opening normally. Close it.
Go to /usr/share/application and open one of the launchers there with Kate (no need to edit anything there). Close Kate and this folder.
Hit the mentioned shortcut again.
You will probably notice, the terminal is opening differently now.
su - <username> does indeed work, but only for the currently opened terminal. As soon as I close the terminal and open it again, the root prompt is back.
@ jamison20000e
Please don't forget, this is about Kubuntu 21.04, which means, it's a KDE, not XFCE. Therefore, there's no Thunar and no custom actions in Kubuntu. Instead of that, there's Dolphin with some services available there. In its context menu, there is no option "Open as root", originally. I had to download and install this option as a new service.
EDIT: Sorry, I have to apologize for confusing Thunar with Dolphin in #4. Of course it is Dolphin. I fixed this mistake already in #4.
Actually, I'd prefer Dolphin, which is the intended file manager for Kubuntu. If somebody has an idea, how to fix the problem with Dolphin, let me know, please.
... "open a folder as root". I found that option in the settings of Dolphin, within the new services of Dolphin (as a download) and added that option accordingly. ...
I* can only assume this is the addon: ("Download New Services...":) https://store.kde.org/p/1384645/ KDE, especially *buntu will take us in many directions not planed by the operating systems "maintained" package manager.
I.e:
Quote:
[flightofthenavig@tor applications]$ sudo dolphin
[sudo] password for h:
Executing Dolphin with sudo is not possible due to unfixable security vulnerabilities.
So, I'm also assuming that for us to reproduce your error we'd need to install "run as root" from Dolphin's settings? (Not recommended. Nor do I *buntu. )
Opining one of those.desktop files "properly" as root, me:
Code:
sudo vi
as kate:
Quote:
Executing Kate with sudo is not possible due to unfixable security vulnerabilities. It is also not necessary; simply use Kate normally, and you will be prompted for elevated privileges when saving documents if needed.
plus many other things I just tried have not reproduced minus your misuses...
Indeed, it looks like the one, I installed, but I didn't get it from your link, but from the Dolphin settings->Configure Dolphin->Services->Download new services.
There are two versions available there, but the other one is meant for Plasma 4, but since Kubuntu 21.04 is using Plasma 5, I took the according one, of course.
Quote:
So, I'm also assuming that for us to reproduce your error we'd need to install "run as root" from Dolphin's settings?
This should be only a minor issue, if you create a Timeshift backup first, just for the very unlikely worst case.
Or maybe a virtual box installation of Kubuntu will do for such a test.
Not exactly sure about it, but currently, it looks like there's only the /usr/share/applications folder involved in this (got no idea, why!), because I just installed the Hibiscus home banking tool in Kubuntu manually, where I had to extract the program folder, called /jameica, from the downloaded zip and paste it into /opt.
Prior to this, I copied the ~/.jameica profile from a previously used Mint installation into my home folder of Kubuntu and then Hibiscus was instantly running perfectly.
To copy the extracted /jameica folder into /opt, I had to use the "Open as root" option of Dolphin.
But afterwards, testing the terminal again, there was still the ordinary user prompt.
Rem.: If anybody is confused about Jameica and Hibiscus, ... Jameica is sort of a JAVA platform and Hibiscus is a home banking plugin of Jameica.
EDIT:
Quote:
Executing Kate with sudo is not possible due to unfixable security vulnerabilities. It is also not necessary; simply use Kate normally, and you will be prompted for elevated privileges when saving documents if needed.
Yes, I realized this, too, the other day.
After examining this issue for a few days now, finally, I also realized, I don't need an option to open Dolphin as root in Kubuntu.
Just edit a file as you wish, save it and if root, respectively its password, is needed, Kubuntu will ask you for it.
More and more, I'm coming to the conclusion, I better just uninstall that added service from Dolphin and everything will be fine.
Again, sorry, for my mistake about Thunar. Hopefully, nobody took it personally.
Actually, I'd prefer Dolphin, which is the intended file manager for Kubuntu. If somebody has an idea, how to fix the problem with Dolphin, let me know, please.
You will have to recompile dolphin and patch it. Or use slackware.
Unthinkable to deny root user access. Just nuts.
I also wonder, why there's no such an option in Kubuntu. I know several other distros and all of them do have this option "open as root".
This means, all of these other distros ignore the mentioned security issues? Can't be so dangerous then, can it?
Microcoughed makes it harder to login as the administrator but I'm pretty sure you can open explorer as the admin from a user login; canonical knows better?
One problem with Linux is it goes in so many directions. Another only someone whould say, is it's become mainstream?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.