How to use sudo access in GUI
Hello,
I was wondering if someone could inform me on how you would go about using sudo in Gnome and KDE. I usally use the terminal personally but I had a friend that is new to linux asking me a bunch of questions and I couldn't answer that one for him, needless to say he didn't like my "just use the terminal answer" So how does one do this in Gnome and or KDE. He is currently using Gnome with Nautilus, however I'm sure the time will come when he messes around with KDE as well. Thanks! |
kdesu for Kde and gksudo for Gnome - as in "kdesu <program name>" or "gksudo <program name>". The Kde command requires the root password though.
https://launchpad.net/kdesudo will be a KDE frontend for sudo once complete. |
Having root access just like that would beat the purpose of sudo. It would be dumbing down Linux to what windows is in the hands of most people: a system where pretty much anything goes. But if that is the only option, one may as well pick a system that allows one to log in as root and work under the root account all the time. No good but, well, I'm sure you already know that. The alternative is modifying one's menu entries in such a way that you a message box popping up to request the root password first. That would be equivalent to the sort of behaviour that one sees when one selects a task from the menu that requires root permissions (say, the Firewall menu item). I haven't seen any need for this but I imagine it could be achieved relatively easily using gksu or gksudo.
|
Hello,
I guess what I'm trying to ask is, i don't want to run as root I just want to know how you would do a sudo in the GUI much like if I where in the terminal trying to copy some files around and it said permission denied I would sudo my cp and away I go. How would you do something like this in the GUI. For instance, lets say I want to copy a file from my desktop into a folder somewhere in my directory structure and it gives me a access denined. How would you accomplish the same effect as doing a sudo in the terminal execpt in the Gnome GUI without logging in as root ? |
In that case, you could install a file manager (something like midnight commander, for example) and then edit the menu entry: if that entry has "gksudo command" instead of simply "command", it will pop up an authorization box before launching the application. Once you have submitted proper authorization, the file manager will give you all the access that you would get from sudo in a CLI.
|
Quote:
|
Quote:
What I do is enter "konqueror" in the KDE Run Command panel, check "Run as a different user", and enter "root" and my root password in the respective boxes. If you need to do this repeatedly then you could create a menu item that runs your file manager of choice as root (in fact some distributions have such a menu item by default). |
Rustylinux:
You can change any menu item to read gksudo [application] (or kdesudo ...) instead of [application]; if you configure the /etc/sudoers file in the right way (it probably is already), the confirmation box mentionned above pops up. But I think it'd be important to explain to the guy in question that he should limit himself to the system administration tasks he's meant to use until he's got a little experience - as soon as he's root (or doing things as if he were root) and goes trying out stuff, he can - and probably will - mess up things; of course, this can be desired for pedagogical purposes... Just make sure your not the guy who has to fix things in that case, then ;) Anyway, if he's becoming aware of the fact that not being root is a win in many cases (security-wise) he can be taught what is necessary in due time. That may sound conservative and patronising, but from supporting distributions that didn't erect that extra barrier I know what harm can come from careless usage of root privileges (and I know many who'd agree). However, if he's really put off by the need to enter a password, you can change the /etc/sudoers file accordingly. I normally wouldn't, but I have used (and supported) systems that are configured that way because a lot of new users (coming from WinDoze) expect it to be that way. If they're sensible enough about it (and are used to locking their terminal when they leave it), it's not too bad, but still a security risk. All in all, the better behaved (experienced?) a user is, the less will she/he feel the need to become root on a daily basis (if she/he's not a sysadmin, but that's a completely different story). hand_of_fate: I think that precisely this simple approach is perceived as "complicated" by many WinDoze users... I always have an xterm open for all purposes, and it's great for just about everything, but I know for a fact how intimidating this is for people who're not used to the CLI. Heck, it literally keeps certain people off my box altogether :D M. |
Quote:
|
Quote:
Quote:
Quote:
Quote:
|
Quote:
Quote:
Quote:
Quote:
|
Quote:
Quote:
Quote:
Quote:
|
Sigh, this is going to be a great year. You know you are the second one in two days to misrepresent what I wrote only to make an argument out of it? A lot of people appear to be very,very bored these days. Here is what I wrote only a few posts ago:
Quote:
Quote:
Quote:
So what is next? Are you going to object that the menu is, in fact, only a front-end to the terminal??? |
Oh man - the poor guy just needs to do gui operations in privileged mode.
@RustyLinux Basically, your friend needs an icon/launcher/menu entry (you get the idea) on which he can click and launch Nautilus (since you mentioned he is using Gnome, Nautilus is the default file manager). So just get him to do this: -- 1. Right-click on the desktop 2. Choose "create launcher" (I may be missing the exact term). This will basically create a shortcut. 3. A dialog box pops up with fields to enter the name of the shortcut, the description and the command to be executed when this is double-clicked 4. Enter "sudo nautilus" (without double quotes) in the command field. Enter whatever you like in the name, description section. 5. Thats it - click ok and you have an icon on your desktop - you double click on it to launch nautilus which will run in privileged mode. -- Just ask him to use it sparingly. HTH |
Quote:
Quote:
Secondly, at no point did I even make any mention of using the CLI. Quote:
I am doing a service to anyone reading this thread by saving them the effort of installing an extra file manager for no reason. Some credit for this service would be appreciated, and would certainly be more appropriate than your constant argument. |
Quote:
Quote:
|
Quote:
|
One correction - it should be "gksudo nautilus" instead of "sudo nautilus".
|
All times are GMT -5. The time now is 11:54 PM. |