CHAPTER 14 UNDERSTANDING LINUX FILES AND (Web site) USERS

CHAPTER 14 UNDERSTANDING LINUX FILES AND USERS ROOT VS. SUDO Most versions of Linux have two types of user accounts: standard and root. Standard users are those who can run programs on the system but are limited in what they can do. Root users have complete run of the system, and as such, are often referred to as superusers. They can access and/or delete whatever files they want. They can configure hardware, change settings, and so on. Most versions of Linux create a user account called root and let users log in as root to perform system maintenance. However, for practical as well as security reasons, most of the time the user is logged in as a standard user. Ubuntu is different in that it does away with the root account. Instead, it allows certain users, including the one created during installation, to temporarily adopt root-like powers. You will already have encountered this when configuring hardware. As you ve seen, all you need to do is type your password when prompted in order to administer the system. This way of working is referred to as sudo, which is short for superuser do. In fact, the command sudo will let you adopt root powers at the shell prompt simply preface any command with sudo in order to run it with root privileges. In some ways, the sudo system is slightly less secure than using a standard root account. But it s also a lot simpler. It reduces the chance of serious errors, too. Any command or tweak that can cause damage will invariably require administrative powers, and therefore require you to type your password or preface the command with sudo. This serves as a warning and prevents mistakes. If you re an experienced Linux user and want to invoke the root account, simply type the following at the command prompt: sudo passwd root Then type a password. If you subsequently want to deactivate the root account, type this: sudo passwd l root Viewing Permissions When you issue the ls -lcommand, each file is listed on an individual line. Here s an example of one line of a file listing from my test PC: -rw-r–r– 2 keir keir 673985982 2005-10-31 17:19 myfile The r, w, and symbols on the very left of the listing indicate the file permissions. The permission list usually consists of the characters r (for read), w (for write), x (for execute), or (meaning none are applicable). They re followed by a number indicating the link count, which you can ignore. After this is listed the owner of the file (keirin the example) and the group that he belongs to (keir). This is followed by the file size (in bytes), then the date and time the file was last accessed, and finally the filename itself appears.

Leave a Reply