download; ebook; do ÂściÂągnięcia; pobieranie; pdf
Pokrewne
- Start
- Fred Saberhagen The Book of the Gods 05 Gods of Fire and Thunder
- Hollywood Hills Holly and Alexa_Book 3 Aimee Friedman
- Fred Saberhagen Book of the Gods 01 The Face of Apollo
- Cyberpunk 2020 Reference Book 5.0
- The Blazing Lights of the Sun and Moon
- Greg Bear Songs of Earth 02 The Serpent Mage
- Alan E. Nourse Gold in the Sky
- Bova, Ben Children of the Mind
- 047. Carlisle Donna Na śÂ‚asce śźywiośÂ‚ów
- Loius L'Amour High Lonesome v1.0 (BD)
- zanotowane.pl
- doc.pisz.pl
- pdf.pisz.pl
- myszka-misiu.keep.pl
[ Pobierz całość w formacie PDF ]
your file system. To move files around in a file system, you have to have places to move them to
and from. These places are called directories. Directories are really files that contain other files.
Files can be placed inside a directory and moved from one directory to another.
Directories can be placed inside each other. A directory contained inside of another directory is
called a sub-directory .
To move a file or directory, we need to use the mv. mv requires that you have at least to parameters
when moving files. (Some people call these arguments .)
The first parameter is the source file, or the name of the file you want to move. The second
parameter is the destination, or the place you want to move the file to. If you specify a directory as
the destination, it will place that file in the directory specified. If you give it a file name as the
destination, it will rename your file. If you move a directory using mv, it will rename the directory.
For Example:
mv /usr/local/junk.html /usr/local/www/ mv /usr/local/html /usr/local/www mv /usr/local/junk.html
/usr/local/www/index.html mv /usr/local/junk.html /usr/local/www/ mv junk.html junk.htm mv
/usr/local/html/* /usr/local/www/
16.5. Managing Permissions *
Security is a big issue in today s anyone-can-access-your-site Internet environment. For the
new-to UNIX user and even system administrator, keeping access permissions set properly on files
can be a major chore.
Permissions to a file allow a user to read, write, or execute a particular file based on whether he is
the owner of the file, a member of the group that owns the file, or an ordinary user that is trying to
use the file. UNIX lets you set the accessibility permissions for each of the three categories.
Individual file permissions are set with the command chmod. The command umask is used to set the
default permissions that a file gets when it is created. chmod and umask use a number and column
scheme to represent the particular permissions and the category that they apply to.
There are four columns and four numbers (if you count zero). The columns represent the categories
that the permissions apply to and the numbers are the read and write permissions.
The Columns:
|column1 | column2 | column3 | column4|
|Special | Owner | Group | Others |
The Numbers:
In Column 1 only: 4 |Set User ID On Execution.
2 |Set Group ID On Execution.
1 |Set the Sticky Bit.
0 |Remove all Special options
In Columns 2-4 4 |Grant Read Permissions
2 |Grant Write Permissions
1 |Grant Execute Permissions
0 |Remove all permissions from column
If you specify less than four digits when setting permissions it will assume that you are starting
from column 4 and work backwards, in other words chmod 22 file will set the read permissions
of file to write for group and others. chmod 24 file and chmod 0024 file are exactly the
same. This however will remove all permissions from the user, a better one to use would be chmod
644 file for standard files and chmod 755 file for executable files. You can have no more than
4 digits, each corresponding to a column.
You can set both read and write permissions to a column by adding the numbers together. Write(2)
+ Read(4) = Both Read and Write(6). Therefore to set read and write permissions to Owner ,
Group , and Others ; you would use chmod 666 file
The file bsd.gif has been set to mode 664 using the command chmod 664 bsd.gif
An ls -l will display the permissions of all the files in the current directory.
>ls -l
total 21
drwxr-xr-x 2 chrisc bsdbook 512 Mar 21 00:50 articles
-rw-rw-r-- 1 chrisc bsdbook 926 Mar 21 16:01 blueball.gif
-rw-r--r-- 1 chrisc bsdbook 1901 Mar 21 23:50 book.html
-rw-rw-r-- 1 chrisc bsdbook 7100 Mar 21 15:57 botbar_raw.gif
-rw-rw-r-- 1 chrisc bsdbook 2088 Mar 21 15:57 bsd.gif
drwxrwxr-x 3 chrisc bsdbook 512 Mar 22 00:02 cgi-bin
drwxrwxr-x 2 chrisc bsdbook 2560 Mar 21 15:50 docs
-rw-rw-r-- 1 chrisc bsdbook 0 Mar 22 00:15 file
-rw-rw-r-- 1 chrisc bsdbook 2865 Mar 21 15:47 umask.sgml
^^^^^^^^^^ These are the permissions.
The d tells us which files are directories. Directories must have execute permissions enabled in
order for a user to change directories to it. A - in the first field signifies an ordinary file, in the
other fields it signifies a lack of permissions, or a permissions of 0 .
When a file is created the default permissions are set at 666. Umask does just the opposite job of
chmod. It removes permissions from the default values at creation time based on the number and
column scheme. Therefore to have your files set to read and write by Owner , but read only by
Group and Others , you would use a umask of 22. The Line
umask 22
can be put in your .login file and automatically set every time you login.
The Default Permissions: 666
Your Umask Values: 22
____
Your New Default Permissions: 644
Now every time you create a file it will have the New Default permissions. A umask of 66 would
give you Default permissions of 600, giving only the owner read and write access to the file. chmod
can also modify permissions to files using a first letter short notation. This style of using chmod
works exactly the same as the Column and Number Scheme. However, it is easier for new users to
remember and use. Consequently it gets a lot of use in everyday tasks, while the Column and
Number Scheme gets a lot of use by programs and scripting languages.
Permissions Types:
r Read
w Write
x Execute
Affected Area: (column)
u User
g Group
o Others
a All
Method Affected:
+ Add to
- Remove from
= Set equal to
To add execute permissions to all areas of the file bsd.gif , you would use chmod a+x bsd.gif
To remove read permissions from Others use chmod o-r bsd.gif.
Now you can control the initial permissions of files and modify those permissions later to suit your
needs.
16.6. Text Editing in System Administration: vi *
16.6.1. CURSOR MOVEMENT:
16.6.2. TEXT ENTRY MODE:
16.6.3. Cut N Paste:
16.6.4. Special:
[ Pobierz całość w formacie PDF ]