1

I've installed Ubuntu Server in to a VirtualBox virtual machine. I've been able to get the GNOME desktop environment setup on it (The default Ubuntu version). This is an educational LAMP server, so I'm not concerned about the performance cost.

I'm trying to do some very minor reconfiguration of Apatche2 but in order to do this, I need write access to the files at /etc/apache2/sites-available (I think).

I'm still very new to Linux but I'm getting there. I understand that I need to change the file permissions to alter these files. (At least, according to my book). But I have to ask if there is a way to temporarily give myself super user access for a temporary time frame. Similar to sudo -i.

I'd prefer to do these changes from within the desktop environment...

If there is not a way to temporarily enable super user access (or root access), how can I change the file permissions so that I may alter the Apache configuration? My attempts at chmod is failing...

3 Answers 3

1

You can run a root file browser with gksudo nautilus.

This will allow you to either open the file as root (recommended) or change the permissions under the properties menu.

3
  • I didn't test it but this is closest to what I was looking for. Thank you.
    – Frank V
    Jul 30, 2009 at 19:59
  • It's generally a bad thing to run any graphically application (especially file browsers) with root privileges. Jul 30, 2009 at 20:03
  • What's so bad about it?
    – DLH
    Jul 30, 2009 at 20:05
1

The answer was staring me in the face. In terminal, navigate to the location of the file and then run the following:

gksudo gedit FileToEdit

This will start the editor with admin privileges for that file only. This is probably one of the safer ways to accomplish what I need...

gksudo: http://www.psychocats.net/ubuntu/graphicalsudo

2
  • +1 since it's much better than starting whole nautilus as root. Jul 30, 2009 at 20:04
  • This will work fine, but I would recommend using gksudo. It's just safer. See psychocats.net/ubuntu/graphicalsudo
    – DLH
    Jul 30, 2009 at 20:12
0

As you have already recognized is the sudo command used to execute commands with the rights of other users. The default user which sudo uses if you don't specify another one is the root user.

Just use sudo vim /etc/apache2/sites-available to modify the file as root.

1
  • Good point - I didn't think of that - but this isn't a preferred solution...
    – Frank V
    Jul 30, 2009 at 19:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .