LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Making my GUI user a root user. (https://www.linuxquestions.org/questions/linux-newbie-8/making-my-gui-user-a-root-user-858202/)

LittlePenguin 01-23-2011 06:27 PM

Making my GUI user a root user.
 
Hi.

Im using Debian Squeeze, and I need to give to my gui user (the gnome user I think its called) root permision, I mean, I want to explore, read and write anything I want using my GUI user, how can I do it?.

Thx.

EDDY1 01-23-2011 06:30 PM

You can use the Alt+f buttons.

sycamorex 01-23-2011 06:31 PM

It's a very bad idea. You shouldn't log in as root (or anything with such privileges) in GUI (if that's what you want to do)

Why do you want to do it, anyway?

LittlePenguin 01-23-2011 06:38 PM

Quote:

Originally Posted by EDDY1 (Post 4235378)
You can use the Alt+f buttons.

What is that?

@sycamorex cuz Im the only one using this pc and cuz I need to run Aptana (an IDE) and to be able to modify /var/www to make web tests, right now I cant.

EDDY1 01-23-2011 06:48 PM

Easier to use su or sudo
Using alt=F buttons only give a terminal similar to the terminal that you open.

LittlePenguin 01-23-2011 06:54 PM

You dont get it...

If I use su or sudo, Im making my TERMINAL user a root user, but my GUI user (the one that clicks everything :P ) is still having restrictions.

lazlow 01-23-2011 07:02 PM

You seem to be missing the point. You su - in terminal and start the app with root privileges(all the advantages without so much risk).

For instance:

Quote:

[fred@localhost ~]$ su -
Password:
[root@localhost ~]# gedit

Starts and instance of gedit with root priveges and path.

TobiSGD 01-23-2011 07:02 PM

Make a new group, I will call it web. Then change the owner of /var/www to root:web. After that add your user to the new group. You should be able to modify the /var/www-folder now, without being root.
In short:
Code:

addgroup web
chown -R root:web /var/www
usermod -a -G web yourusername


frankbell 01-23-2011 07:11 PM

You should not give your user logon root privileges, but you can enable a root logon to the GUI.

This works on Lenny. I suspect that it will work on Sid and Squeeze also, though I haven't used them.

On the Debian log in screen, go to Actions-->Configure the Login Manager and click OK.

Debian will ask for the root password. Enter it.

When the dialog box appears, click the "Security" tab, then select "Allow local administrator logon."

Editorial:

Ubuntu has convinced a lot of folks that logging in as root is inherently a bad thing.

It's not.

Logging in as root and then doing stupid stuff is inherently a bad thing. Stupid stuff=bad thing.

Root can find the GUI more convenient than the command line, just as user does.

chrism01 01-23-2011 07:44 PM

Post #8 is a good solution.
Don't hack around in root unless you're changing system cfg files; NOT for web pages and the like.

ericson007 01-24-2011 12:27 AM

Most definately do it as per post #8. Most distros have root login via the graphical login disabled by default as it is a risk to do so.

In the case of your web folder, another reason to have it run and be edited as a seperate user, is that if it will be facing the internet, then it will be safer by possible crackers only being limited to those directories rather than the whole system.

Another problem that you will most likely run into seeing that you are using an IDE is with permissions when files are executed by the www daemon and then having to write data into a root owned file. This will not be allowed and as a result your applications may have issues running. So as per post #8 quite a few problems are solved in a single easy step.

All the best with your developments.

Kenny_Strawn 01-24-2011 12:44 AM

If the root account is locked, you can unlock it by:

Code:

sudo passwd
This will allow you to enter a new password for the root account that will allow you to log in as root without a problem.

jdkaye 01-24-2011 03:27 AM

No need to log into your gui as root. You can use gksu and/or gksudo to run specific applications while logged in as a normal user.
ciao,
jdk

LittlePenguin 01-24-2011 08:02 AM

Quote:

Originally Posted by TobiSGD (Post 4235411)
Make a new group, I will call it web. Then change the owner of /var/www to root:web. After that add your user to the new group. You should be able to modify the /var/www-folder now, without being root.
In short:
Code:

addgroup web
chown -R root:web /var/www
usermod -a -G web yourusername


It didnt work, Im stil having read only permission on that folder.

Edit.: I went to the permisions tab under properties and I can see the group "web" but it says: "Access files", and above that there is root and it says: "Create and delete files", but Im not in that group,and web group cant create or delete files.

@frankbell I have no such option in Squeeze.

TobiSGD 01-24-2011 08:07 AM

Did you get any error-messages?
Please post the output of
Code:

ls -l /var/www


All times are GMT -5. The time now is 06:33 PM.