But first, let's briefly explore why this is so important on a Linux system. If you're already familiar with the way file permissions work in Linux, click here to skip over this little lesson.
If you'd like to learn more, read on after the jump.
When you choose to run a program or open a file as an administrator, you're basically telling your system that you have the rights to edit that file or use that program in any way you see fit. This is more important in Linux than in Windows because of the way user accounts are structured in Linux.
There's the super user, or "root," and then the user, you. The super user has full authority to edit, delete, or move any file or program installed on the system. The user has access to those files, but must "ask permission" of the super user to make any changes. The exception to this is the /home folder. This is where documents, photos, music, videos, etc are stored, and the only area of the system where you the user enjoys full rights and permissions.
So what happens if you need to make changes to or delete a file that belongs to the super user? This is where the "sudo" command comes into play. You've probably noticed that A LOT of the terminal commands I've shown here need "sudo" to work. That's because the command we are giving - for example, installing software - requires root permissions to execute.
Factual Nugget: The command "sudo" is short for "super user do."
Unlike a standard Windows installation, which allows the user to always have administrative privileges, Linux by default is setup so that the end user, you, is not the system administrator. Any time you are asked to enter your password on a Linux system, it's because you are telling the system to temporarily elevate your permissions to root status, aka the system administrator. When you are finished with that particular task, the system once again lowers your permissions back to user.
This is actually preferable to the standard Windows setup, because it acts as a safety barrier between the user and the system. Not only does it make you the user think twice about the possibly harmful task you're attempting to perform, but because root privileges are password protected, it prevents intruders or viruses from accessing vital areas of your system, therefore severely limiting any potential damage to your system's files. THIS IS WHY YOU SHOULD AVOID RUNNING LINUX AS ROOT UNLESS ABSOLUTELY NECESSARY
[/soapbox]
Normally, to open a file with root permissions, you either need to run Nautilus (the file manager) as root, which is dangerous, or you need to open up a terminal and type in a command using "sudo" or "gksudo" (for graphical applications). While the terminal option is safer, it's often inconvenient because you have to know the exact path and filename of the file you're looking for - i.e. "gksudo gedit /usr/share/themes/Atolm/gtk-2.0/gtkrc"
So where's the happy medium? As I mentioned before, there's a way to activate that "open as administrator" right-click menu option in Ubuntu, and it's really easy. You just need to install a small program called "Nautilus-gksu."
Open a terminal and copy and paste the following commands one line at a time:
sudo apt-get install nautilus-gksu nautilus -q
That's it. Open up Nautilus and right click on any file to see the "Open as Administrator" option.
Now, if you don't know where a file is located on your system and you need to change it, you can safely browse to it as the user, and only after you've found the file elevate your permissions to root.
Nautilus-gksu is by far the most user-friendly and safest way to gain full access to system files and folders. You should still be careful, of course, but this will severely limit the possibility of costly mistakes, while at the same time introducing a bit of familiarity for Windows users making the switch.
Until next time...


No comments:
Post a Comment