You are not logged in.

#1 2011-05-26 20:16:31

wolfdogg
Member
From: Portland, OR, USA
Registered: 2011-05-21
Posts: 545

[SOLVED] kwrite priveleges

hi all,

on my kde install i would like to use kwrite to edit my conf files. whats the most obvious way to get root privileges to save the files?

Last edited by wolfdogg (2011-05-28 20:19:45)


Node.js, PHP Software Architect and Engineer (Full-Stack/DevOps)
GitHub  | LinkedIn

Offline

#2 2011-05-26 20:24:51

roygbiv
Member
Registered: 2011-05-18
Posts: 204

Re: [SOLVED] kwrite priveleges

sudo kwrite

Last edited by roygbiv (2011-05-26 20:25:08)

Offline

#3 2011-05-26 20:28:10

hermes
Member
From: Lucca, Italy
Registered: 2010-05-19
Posts: 99

Re: [SOLVED] kwrite priveleges

$ su -
Password: <your root password>
$ kwrite /your/conf/file

or

$ kdesu kwrite /your/conf/file

or

Alt+F2 then kdesu kwrite, then open the desired file.

If you have sudo installed,

$ sudo kwrite /your/conf/file

Last edited by hermes (2011-05-26 20:30:52)


Linux Registered User #362737

Offline

#4 2011-05-26 23:48:54

wolfdogg
Member
From: Portland, OR, USA
Registered: 2011-05-21
Posts: 545

Re: [SOLVED] kwrite priveleges

ahh, i like this one

alt+f2
$ kdesu kwrite /your/conf/file

BUT, i was hoping to navigate using the mouse.  is there any way around this?  i want to click the file with the mouse, so i dont have to type in the directories, its exactly what i am trying to avoid when on the dektop, so i want kwrite to prompt me for a root password, when file is clicked on by the mouse.  how would i configure it to do this? 

doesnt that make the most sense for a desktop environ?


Node.js, PHP Software Architect and Engineer (Full-Stack/DevOps)
GitHub  | LinkedIn

Offline

#5 2011-05-27 10:18:52

karoshi
Member
From: Marburg
Registered: 2008-02-26
Posts: 182

Re: [SOLVED] kwrite priveleges

Dont start graphical programs with sudo, it can mess around with the permissions in your home directory, even preventing you from login... (http://unix.stackexchange.com/questions … /3071#3071)

If you have to edit systemfiles with kwrite, start it with

kdesu kwrite

For convenience, you may create an kmenu entry that starts kwrite as root, prompting you for root password.


It's a bug planet!

Offline

#6 2011-05-27 12:12:09

hermes
Member
From: Lucca, Italy
Registered: 2010-05-19
Posts: 99

Re: [SOLVED] kwrite priveleges

wolfdogg wrote:

ahh, i like this one

alt+f2
$ kdesu kwrite /your/conf/file

BUT, i was hoping to navigate using the mouse.  is there any way around this?  i want to click the file with the mouse, so i dont have to type in the directories, its exactly what i am trying to avoid when on the dektop, so i want kwrite to prompt me for a root password, when file is clicked on by the mouse.  how would i configure it to do this? 

doesnt that make the most sense for a desktop environ?

Not tested, but should work. Do it at your own risk!
I wouldn't do it, anyway... I'd prefer to type root password once in a while than render the system prone to vulnerabilities.

First of all you should create a .kde4/share/config/kdesurc file with the following content:

[super-user-command]
super-user-command=sudo

The above assumes you've got sudo installed and correctly configured. You should also let sudo execute kwrite without prompting for your password. Add the following to /etc/sudoers.d/10-cmnd_alias:

Cmnd_Alias EDITORS=/usr/bin/kwrite

You can add other editors separating them with commas. Then add the following to /etc/sudoers.d/20-editors:

<your username> ALL=(ALL) NOPASSWD: EDITORS

Replace <your username> with your username; you can allow an entire group to execute EDITORS with NOPASSWD instead, prepending a % to the group name.
EDIT: chmod 440 10-cmnd_alias and 20-editors.

Finally create, as karoshi said (btw, thanks for the link!), a kmenu entry with 'kdesu kwrite'.

As I previously stated, I don't like this approach, because admin tasks should be done with all the precautions, and you'll agree they're not so frequent, unless you're a sysadmin or you've just installed arch, but you asked it, and this is my solution.

Last edited by hermes (2011-05-27 17:58:09)


Linux Registered User #362737

Offline

#7 2011-05-27 20:26:06

wolfdogg
Member
From: Portland, OR, USA
Registered: 2011-05-21
Posts: 545

Re: [SOLVED] kwrite priveleges

ok, that sounds good, thank you for the links and the detailed steps!

one thing, i do want it to prompt me for a password when it doesnt have access to a file, or when it knows the group is root. 

i would like to create a kmenu entry with 'kdesu kwrite', i guess thats probably what i was looking for, a menu that i can click with the mouse when on the DE, that will allow me to edit conf's. thsi way the only thing i will have to type in is the password, then i can navigate the file with the mouse, and made edits, and then ctrl+s, and x out with the mouse.     

how would i create that menu, i googled it, and brushed on the link included and dont see a reference as to how to do it.


unless you're a sysadmin

well, i use it for an apache "testing" server for local php/mysql development, and currently have xampp, and might upgrade to sraight apache/php/mysql/pear/phpmyadmin etc.. and i have ALOT of configuring to do. Also, knowing myself, i am probably NEVER going to leave the system alone, lol.

Last edited by wolfdogg (2011-05-27 21:10:03)


Node.js, PHP Software Architect and Engineer (Full-Stack/DevOps)
GitHub  | LinkedIn

Offline

#8 2011-05-28 09:28:25

hermes
Member
From: Lucca, Italy
Registered: 2010-05-19
Posts: 99

Re: [SOLVED] kwrite priveleges

wolfdogg wrote:

[...] so i want kwrite to prompt me for a root password [...]

Don't know why, but I read it "i want kwrite NOT to prompt me for a root password"... You can then ignore those detailed steps!
Anyway, to create a kmenu entry, just run kmenuedit, it's quite straightforward.


Linux Registered User #362737

Offline

#9 2011-05-28 10:31:47

wolfdogg
Member
From: Portland, OR, USA
Registered: 2011-05-21
Posts: 545

Re: [SOLVED] kwrite priveleges

lol. ok thanks. i thought your suggestion was on to something, i just couldnt exactly figure how i was going to approach it :-)  well, thanks for the effort. i wasnt sure what i wanted either.  i looked up kmenuedit, and found this documentation http://docs.kde.org/stable/en/kdebase-w … index.html unless somebody knows of something  better, then i will go through it there.


Node.js, PHP Software Architect and Engineer (Full-Stack/DevOps)
GitHub  | LinkedIn

Offline

#10 2011-05-28 14:08:45

SteveK
Member
Registered: 2010-06-11
Posts: 80

Re: [SOLVED] kwrite priveleges

You could try Root Actions Servicemenu. It's in the AUR or install for your user through KGHNS.  I find it very convenient.

Offline

#11 2011-05-28 20:19:29

wolfdogg
Member
From: Portland, OR, USA
Registered: 2011-05-21
Posts: 545

Re: [SOLVED] kwrite priveleges

yes, thats perfect, and solves the issue.  thanks for you help all of you!


Node.js, PHP Software Architect and Engineer (Full-Stack/DevOps)
GitHub  | LinkedIn

Offline

Board footer

Powered by FluxBB