Editing
Linux Basics Tutorial
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Users and Permissions == The permission system in Linux is very useful, as it allows for more specific restrictions than in an OS like Windows. Instead of users being either normal users or administrators, there is only one administrator account, called "root". The root account has total control over the computer. The main idea behind this is that no one will ever log in directly as root. Instead, normal accounts can be added to a list called "sudoers". Accounts in this list have access to a command called "sudo" (or '''s'''uper'''u'''ser '''do''') that allows them to perform an action "as root". This is similar to running something as an administrator in Windows. To be able to do certain actions, such as editing a protected file, a sudoer user can append <code>sudo</code> to the beginning of the command. This will prompt them for their own password, and when they enter it, the command will be run as root. Then, once the command is completed, they are back to their normal user status. This makes sure that users don't accidentally do any actions as root that they don't intend to. Actual permissions for what files can be modified (and by whom) are also slightly different than in Windows. Any file or directory has three permissions associated with them ('''r'''ead, '''w'''rite, and e'''x'''ecute), and those permissions can be associated with a particular user, a user group, or all users. The command <code>chmod</code> changes the permissions of a file or directory. You can either add or remove individual permissions (+x, -w, etc), or supply a number that, when each digit is translated into binary, results in a bitstring representing the permissions. For example, <code>$ chmod 777 myfile</code> allows all users to do everything with myfile, as all the bits will be 1. Files and directories can also be "owned" by a user. The "user" set of permissions specifically applies to the owner of the file. So, if you want a file to only be accessible by a particular user, you can use <code>chown</code> to change the ownership, and <code>chmod</code> to change the permissions to 700 (i.e. full permissions for user, no permissions for anyone else).
Summary:
Please note that all contributions to RHLUG Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
RHLUG Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
Edit source
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information