First of all, I must tell you that this post was totally modified based on the comments of the people made to me
My situation is this: I don't like to use the terminal to do things like copying, creating or deleting files, when nautilus can do that xD, but Linux does not let yo to do that, you can only modify files inside the user folder. In other words, you cannot modify nothing that is not "yours", not with nautilus (and it has a good reason, opening graphical programs may be dangerous)
But I thought I could give to nautilus superuser permissions executing nautilus as root, so I tried that in Fedora 14 Laughlin :
su -c nautilusBut it didn't work xD, I got this error
(nautilus:14179): EggSMClient-WARNING **: Failed to connect to the session manager: None of the authentication protocols specified are supportedThe only solution I could find at that moment was to use SUDO
**
GLib-GIO:ERROR:gdbusconnection.c:2270:initable_init: assertion failed: (connection->initialization_error == NULL)
For those who don't know what's sudo, this is a program which gives to a normal user superuser permissions, but it has to be configured first, we have to add our user to the sudoers list.
I first tried this command
$su -c visudo
Visudo is a tool to modify the sudoers list, but I don't know why it didn't work on me ¬¬ so I decided to do with a "nasty" way xD
$su -c nano /etc/sudoersWith any of those tools we can edit the sudoers list. I added a line here:
.
.
.
## The COMMANDS section may have other options added to it.
##
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
hakS ALL=(ALL) ALL <---- THIS LINE xD
I saved the file and quit. This will add the user to the sudoers list. It was so cool xD I don't like to enter as root all the time and now I don't need to do it . For example, we can do this:
## Allows members of the 'sys' group to run networking, software,
## service management apps and more.
# %sys ALL = NETWORKING, SOFTWARE, SERVICES, STORAGE, DELEGATING, PROCESSES, LOCATE, DRIVERS
.
.
.
$sudo yum install <whatever>Sudo will ask for the user password (not the root password, but your password), it will run as if you were a superuser
Using sudo, I could access to nautilus using sudo
$sudo nautilusAnd voila! nautilus start to run as a superuser! I can now create, copy, modify and delete files outside the user folder.
But just some minutes after I finished this post, someone (http://adamwill.livejournal.com/) told me the only thing I needed to access to any graphical program is to run thos applications puting a "-" after that command, for example:
su -c nautilus -It was so annoying.. ¬¬ but I learned how to do it : ) so thank you http://adamwill.livejournal.com/
su -c gedit -
But after all this, I still have some questions and comments
1- Why is not secure to edit the sudoers file with nano?
2- Maybe running gconf-editor as root is not the best practice xD I just did it for experiments xD
So the things I could learn doing all this is:
1- How to edit the sudoers list
$su -c visudo$su -c nano /etc/sudoers2- How to open a graphical app just using su
$su -c nautilus -Thanks for the comments : ) I hope this post can be usefull to begginers like me :P
$sudo nautilus
7 comentarios:
Do you realize that start X apps with privileges is dangerous?
(surprise, that's why it is not allowed!)
Do you realize that editing the sudoers file with nano is not secure? (hi! that's why visudo exists!)
pd: it's "Laughlin"
pd2: gconf-editor as root? that's just obscene O_o
oh my..........
http://www.rpublica.net/sudo/visudo.html
su -c nautilus -
su -c gedit -
(notice the - on the end. It's important. That fixes the problem you have with running various graphical things as root.)
Thanks for the command with the "-" at the end :)
Also i've use pcmanfm instead nautilus before.
Try that:
$ EDITOR=nano visudo
#bochecha O.o ! I didn't know that... but what's the diference between doing that way and doing by: su -c nano /etc/sudoers?
There is package for nautilus in Fedora called "beesu" and "nautilus-beesu-manager".
It can open nautilus as root, or just open/edit individual files as root from nautilus.
Regards jfoechsler
Publicar un comentario