Search This Blog

Friday, July 3, 2009

Ubuntu First Things: Edit as Root

For most users Ubuntu works just fine out of the box and casual users can use the internet wirelessly, edit using OpenOffice, and so on with little or no problems.

But occasionally, users need to edit files protected by root user access. For developer's and power users this is always the case.

The most elegant solution I've found for this is adding a menu item that launches gedit in root mode.

Step 1.) Right click on any drop down menu label of the main panel (say, Applications). The second menu item is: Edit Menus.

Step 2.) Click Edit Menus. It pops up the following window:



In the column called Menus under Applications, click on the entry called Other.

Now click the New Item Button. We're going to add a gedit launcher that offers root access to files.

In the Create Launcher window, we add the command gksu gedit and give the command a Name that's descriptive such as RootEdit.



Click the OK button. You have successfully added a command called RootEdit (or whatever you decided to call it) as an executable command that will be listed in the Applications menu.



Optional Step) The next thing we'll do is create a new menu called UbunTools.

First click on Applications.

Click New Menu and fill in the blanks as shown or to your liking, then click OK.



You will see UbunTools added to the Menus column in the Main Menu window.

Click on the Other menu item. Drag and Drop our newly created RootEdit command to the UbunTools menu.



Once you successfully drag and drop it to the UbunTools menu, you can delete it from the Other menu by highlighting it and clicking the Delete button.

Step 3.) Close the Main Menu window.

The Applications menu now contains a menu item Called UbunTools that has a RootEdit command that launches gEdit with Root privileges so that you can edit protected files.


WARNING and RULES! a.) Before editing protected files be sure that the instructions you are being given make sense and have been verified by others!

In other words, read everything you can before acting. One person's medicine is another's poison.

Most importantly, SAVE THE ORIGINAL FILE in a backup state. Prefix or postfix the saved filename with something like orig or safe or backup.

Lastly, if you are in over your head technically, don't try to edit protected files, you will regret it.

No comments:

Post a Comment