60 Chapter 4 – A Beginner’s Guide to the Server
Uploading Documents (FTP)
Web Design in a Nutshell, eMatter Edition
From within the telnet session, begin by checking the current permissions and
owner of the directories and files. You need to be the owner to change permis-
sions on a directory’s contents. At the Unix prompt (%or$), typels -lto view the
contents in the long format. The system returns a listing that looks like this:
drwxrwxrwx 2 jen doc 512 May 19 11:25 chap13
The first ten characters reflect the permissions settings. The first character shows
the file type (directory,d, or plain file,-). The next three characters show the read
(r), write (w), and execute (x) privileges for the owner of the file (in this example,
the userjenis the owner). The next three characters indicate the same three
settings for other members of the file’s group. The final three characters show
permissions for all other users.
In the example above, all users have complete access to the file. If certain permis-
sions are turned off, the space is held with a dash (-). In the following example,
the owner has total access to the file, but the group and other users can only read
the file.
drwxr--r--
A complete explanation of all the finer points of thechmodcommand is beyond
the scope of this chapter, but Table 4-2 shows instructions for a few of the most
common settings you’ll need. Type thechmodcommand and number option as
shown, and substitute your directory name fordirname(note, you can use a “dot”
to indicate the current directory.)
A directory’s access permissions help control access to the files in it, such as
adding, deleting, and renaming files. The permissions on a file control what can be
done to the file’s contents, such as reading or editing.
Table 4-2: Common chmod Settings
Type Permissions Command Result
Directory Allows users in your group
to add, delete, and rename
files in your directory. All
others can only view the
directory’s contents.
chmod 775dirname drwxrwxr-x
Directory Restricts access to all users
except the owner.
chmod 700dirname drwx------
File Allows you and your
group to read and edit the
file, but allows all other
users to read only.
chmod 664filename -rw-rw-r--
File Allows you to edit a file,
but allows everyone else
on the system to read only.
chmod 644filename -rw-r--r--
File Makes a private file that
only you can read or edit.
chmod 600filename -rwx------