PDA

View Full Version : [SOLVED] Become root user in GUI



pratporetw
14th July 2012, 10:14 PM
I got fed up with this thing that while working in fedora GUI i can't modify filesystem files and directories. I can make myself root from the terminal but i can't do all my tasks using terminal everytime. I want to add my user in the root list so that i an easily access files and can modify them.

Please someone quickly solve this problem as am in urgent need of being a root.

Fenrin
14th July 2012, 10:31 PM
if you logged in in the terminal as root, you could also start file manager or texteditors from there. Would this be sufficient?

and if you use "su" to switch to root, you maybe can't open some texteditors from terminal like gedit. But with "su -" it should work. You can also start thunar or nautilus from terminal.

pratporetw
14th July 2012, 10:47 PM
but i want even other applications to use system files. like i made file /var/www/html/smarty.php

This file needs a file from /usr/local/lib/smarty/libs/.

when i run /localohost/smarty.php in firefox it shows me this error


Warning: require_once(/usr/local/lib/Smarty-3.1.11/libs/Smarty.class.php): failed to open stream: Permission denied in /var/www/html/smarty.php on line 5

Fatal error: require_once(): Failed opening required '/usr/local/lib/Smarty-3.1.11/libs/Smarty.class.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/smarty.php on line

Wanna get rid of this error

---------- Post added at 03:17 AM ---------- Previous post was at 03:05 AM ----------

Aaah got one problem in the trick you suggested.

When i did run nautilus from terminal being a root user, it gives me error

Could not register the application: The connection is closed

and when i tried running gedit it gave me this error

(gedit:18245): EggSMClient-WARNING **: Failed to connect to the session manager: None of the authentication protocols specified are supported


** (gedit:18245): WARNING **: Could not connect to session bus
[root@prateek prateek]# nautilus
Could not register the application: The connection is closed

but these commands run fine being a normal user

Fenrin
14th July 2012, 11:00 PM
ok to get write and read access for the folder /var/www/html I would add my user to the group apache (either via the graphical user and groups utility or via the file /etc/group). And then enter following commands:

su
chgrp apache -R /var/www/html
chmod g+rw -R /var/www/html

then you probably have to set some SELinux flags to on. Interesting flags for this for example: httpd_read_user_content, if you want to connect to a database httpd_can_network_connect_db, maybe httpd_builtin_scripting.

that's how you enable a flag (it will might need several minutes until it completed this operation):

setsebool -P httpd_can_network_connect on

you can check SELinux flags from terminal via

getsebool -a | grep httpd
or

getsebool -a | grep user


---------- Post added 15th July 2012 at 12:00 AM ---------- Previous post was 14th July 2012 at 11:56 PM ----------


[...]
[/COLOR]Aaah got one problem in the trick you suggested.

When i did run nautilus from terminal being a root user, it gives me error

Could not register the application: The connection is closed

and when i tried running gedit it gave me this error
[...]

did you login as root via "su -" (the "-" is important)?

If it still doesn't work, you can just install leafpad and thunar and use this instead, this will certainly work also from terminal.

pratporetw
14th July 2012, 11:09 PM
Thanks
Unfortunately this didn't worked for me. Still getting the same error. M frustrated with this

---------- Post added at 03:39 AM ---------- Previous post was at 03:36 AM ----------

Sorry i made mistake in invoking the command su. Thanks for reminding me.

But my firefox problem is still not solved

oboedad55
14th July 2012, 11:10 PM
Install "beesu". Then assuming for example, gnome then alt-f2 and "beesu nautilus".

pratporetw
14th July 2012, 11:13 PM
@oboedad55

Please clarify what this beesu do. I think this will just let me use nautilus as root user i think. But this problem is already solved using su -

Fenrin
14th July 2012, 11:41 PM
[...]

But my firefox problem is still not solved

maybe this command helps:

chcon -R -h -t httpd_sys_content_t /var/www/html

a guide about SELInux and apache server issues is here (http://www.yolinux.com/TUTORIALS/LinuxTutorialWebSiteConfig.html#HTTPD) (interesting parts especially "Apache Web Server configuration" and "SELinux security contexts").

solo2101
14th July 2012, 11:50 PM
no one recommends what you ask for... that said...

this guide was really helpful for me

http://www.tejasbarot.com/2011/11/09/howto-login-as-a-root-from-gui-on-fedora-16/

---------- Post added at 03:50 PM ---------- Previous post was at 03:46 PM ----------

usually the

[solo@f16 ~]$ su -
Password:
[root@f16 ~]# nautilus (or any other program)
'Initializing nautilus-gdu extension


works for me

pratporetw
15th July 2012, 12:15 AM
thanks for the guide solo2101.........

this was my actual problem that no one was able to solve.
But i am glad that i learned the "su -" method too.

Thanks to all