How to use mouse to open a file/link with app as sudo/root in Desktop?

For example, I have a link to a 600 file, or I have a 600 file in Desktop

[vvn@arch Desktop]$ pwd
/home/vvn/Desktop
[vvn@arch Desktop]$ ls -al | grep shadow
-rw------- 1 root root 715 May 13 11:42 shadow
lrwxrwxrwx 1 vvn vvn 11 May 13 11:40 shadow link → /etc/shadow

I want to open them with chosen software, such as Kate, Kwrite.
I can’t do that because I don’t have permission. There is no “open as administrator” option at Desktop.
How to open as administrator in Desktop?

Have you checked for extra stuff/download of new services in Dolphin? There should be something that can handle your problem some way or similiar.

hi, welcome

you need to enable Administrative actions

if you don’t see it there then go to discover and install

kio-admin

if it still doesn’t work then you must be using kubuntu 24.10 and you should upgrade to 25.04

I have kio-admin and Administrative Actions. And I have “open as administrator” in dolphin context menu.

But I am asking Desktop, not Dolphin

if you have a link to file owned by root on your desktop, you should be able to just open it with the the application in read only mode.

i placed a link to /etc/grub.d/40_custom on my desktop and was able to open it with kate just fine.

however if i tired to change the file and save those changes it would prompt me for the password to grant me administrative privilege.

1 Like

Is your root owned /etc/grub.d/40_custom permission 600? If yes, you should not possible to open it in read only mode.

And I found one more problem, even in Dolphin, if the directory is Desktop, there is still no open as administrator.

this option only display at /etc

Hi - I suspect that this enough of a niche use case that you may either need to figure out a service menu-based approach, or submit a feature request and see if a developer is available and interested.

It would seem logical that a user’s personal Desktop directory would almost never be home to a file that isn’t editable - or even accessible - by that user, so that might not have been accounted for in designing the kio-admin code.

I accidentally found a solution, and it’s a bit strange: you can’t open the file as an administrator (there is no menu - open as administrator), but if you just open such a file in the editor, edit it and click save, a sudo password entry window will open, after which the file will be saved :slight_smile:

Good callout that Kate/KWrite does have that very nice feature, as mentioned above. :slight_smile: The catch there is detailed in the follow-up, though, since the file isn’t even readable by the user whose home directory it’s (linked) in.

ah, i see the issue now and i can confirm that dragging link to a locked folder like /root onto the desktop will give me a link but i cannot open it… nor is there an administrator option to do so.

same is true when viewing the desktop from within dolphin, in fact no matter where i place it i cannot open it in dolphin.

i can however open /root as administrator if i navigate directly to the actual /root folder in the tree, so this issue is not with kio-admin addon but rather at a deeper level with what is expected behavior i the /home folder with respect to permissions in other parts of the system.