Title: Network and system administration
1Network and system administration
- Engineering for managing a human - computer
system. - Challenges
- Designing a network which is logical and
efficient - Deploying large number of machines which can be
easily upgraded later - Deciding what services are needed
- Planning and implementing adequate security
- Providing a comfortable environment for users
- Developing ways of fixing errors and problems
which occur - Keeping track of and understanding how to use the
enormous amount of knowledge which increases
every year
2Meta principles
- Principle 1 (Policy is the foundation)
- System administration begins with a policy a
decision about what we want and what should be,
in relation to what we can afford. - Principle 2 (Predictability)
- The highest level aim in system administration is
to work towards a predictable system.
Predictability has limits It is the basis of
reliability, hence trust and therefore security. - Principle 3 (Scalability)
- Scalable systems are those that grow in
accordance with policy i.e. they continue to
function predictably, even as they increase in
size.
3Good advices
- Independence, or self-sufficiency in learning. We
cannot always ask someone for the right answer to
every question. - Systematic and tidy work practices.
- An altruistic view of the system. Users comes
first collectively and only then individually. - Balancing a fatalistic view (the inevitability of
errors) with a determination to gain firmer
control of the system. - Avoid
- The belief that there exists a right answer to
every problem. - Getting fraught and upset when things do not work
the way we expect. - Expecting that every problem has a beginning, a
middle and an end (some problems are chronic and
cannot be solved without impractical
restructuring).
4Checklist
- Look for answers in manuals and newsgroups.
- Use controlled trial and error to locate
problems. - Consider all the information listen to people
who tell you that there is a problem. It might be
true, even if you cant see it yourself. - Write down experiences in an A Z (notebook) so
that you learn how to solve the same problem
again in the future. - Take responsibility for your actions. Be prepared
for accidents. They are going to happen and they
will your fault. You will have to fix them. - Remember tedious jobs like vacuum cleaning the
hardware once a year. - After learning about something new, always pose
the question how does this apply to me?
5Operating system
- Software for driving the hardware (keyboard, disk
dirives, screen, ). The most important part of
the software is the kernel - A filesystem that can handle the files logically
- A user interface which enables the users to
manipulate their own files in a simole way - Opererating systems are divided in single / multi
user and single / multi tasking. Clearly a
multi user system is also multi tasking - In a multi user environment it is important to
protect the different users form each other - In a multi user environment a super user (an
administrator, a root) is aquired that can act on
behalf on every user of the system. - No one should use a privileged root or
Administrator account as a user account. To do so
is to place the system in jeopardy. Privilege
should be exercised only when absolutely necessary
6Filesystems
- In Unix this is hierachical with the root at /
- In Unix all devices (floppies, cds, extra hard
disks) are attached to this file tree at some
point. This is unlike Windows where different
devices are attached to different letters, A,
B, C,D,
7Short review
- file permissions, time stamps and ownership
- commands ls, chown, stat and touch
- example
geirs_at_compaq/usr/local/apache2/htdocs/schedulegt
ls -l total 36 drwxr-xr-x 2 geirs users 440
2004-11-29 1425 basic drwxr-xr-x 2 geirs users
112 2004-11-29 1425 fix drwxr-xr-x 2 geirs
users 288 2004-11-29 1425 general -rwxr-xr-x 1
geirs users 1363 2004-11-29 1852
index.phtml -rwxr-xr-x 1 geirs users 560
2004-11-29 1425 logout.phtml -rwxr-xr-x 1 geirs
users 6557 2004-11-29 1425 main_level0.phtml -rwx
r-xr-x 1 geirs users 3311 2004-11-29 1425
main_level1.phtml -rwxr-xr-x 1 geirs users 2121
2004-11-29 1425 main_level2.phtml -rwxr-xr-x 1
geirs users 1315 2004-11-29 1425
main.phtml -rwxr-xr-x 1 geirs users 483
2004-12-01 1444 print.css drwxr-xr-x 2 geirs
users 336 2004-11-29 1425 report drwxr-xr-x 3
geirs users 232 2004-11-29 1425
reservation -rwxr-xr-x 1 geirs users 1185
2004-11-29 1425 schedule.css drwxr-xr-x 2 geirs
users 240 2004-12-01 1415 subjects
8short review
- There are many attributes attached to a file
- Type
- Ownership and permissions
- Size
- Filename
- Timestamp
- ls -l does not reveal everything. Timestamp
contains following information - When the file content was last modified
- When the file status was last modified
- When the file was last reead
- We will look into it
9Short review
geirs_at_compaq/tmpgt touch a b c geirs_at_compaq/tmp
gt ls --full-time total 0 -rw-r--r-- 1 geirs
users 0 2005-01-01 200428.522950920 0100
a -rw-r--r-- 1 geirs users 0 2005-01-01
200428.522950920 0100 b -rw-r--r-- 1 geirs
users 0 2005-01-01 200428.522950920 0100
c geirs_at_compaq/tmpgt cat a geirs_at_compaq/tmpgt
ls --full-time total 0 -rw-r--r-- 1 geirs users
0 2005-01-01 200428.522950920 0100
a -rw-r--r-- 1 geirs users 0 2005-01-01
200428.522950920 0100 b -rw-r--r-- 1 geirs
users 0 2005-01-01 200428.522950920 0100
c geirs_at_compaq/tmpgt chmod 744
b geirs_at_compaq/tmpgt ls --full-time total
0 -rw-r--r-- 1 geirs users 0 2005-01-01
200428.522950920 0100 a -rwxr--r-- 1 geirs
users 0 2005-01-01 200428.522950920 0100
b -rw-r--r-- 1 geirs users 0 2005-01-01
200428.522950920 0100 c geirs_at_compaq/tmpgt
echo Hei gt c geirs_at_compaq/tmpgt ls
--full-time total 4 -rw-r--r-- 1 geirs users 0
2005-01-01 200428.522950920 0100 a -rwxr--r--
1 geirs users 0 2005-01-01 200428.522950920
0100 b -rw-r--r-- 1 geirs users 4 2005-01-01
200540.556000232 0100 c
10Short review
geirs_at_compaq/tmpgt stat File a' Size 0
Blocks 0 IO Block 4096
regular empty file Device 306h/774d Inode
86471 Links 1 Access (0644/-rw-r--r--)
Uid ( 1000/ geirs) Gid ( 100/
users) Access 2005-01-01 200453.156206096
0100 Modify 2005-01-01 200428.522950920
0100 Change 2005-01-01 200428.522950920
0100 File b' Size 0 Blocks
0 IO Block 4096 regular empty
file Device 306h/774d Inode 99540
Links 1 Access (0744/-rwxr--r--) Uid ( 1000/
geirs) Gid ( 100/ users) Access
2005-01-01 200428.522950920 0100 Modify
2005-01-01 200428.522950920 0100 Change
2005-01-01 200520.332074736 0100 File c'
Size 4 Blocks 8 IO
Block 4096 regular file Device 306h/774d
Inode 99754 Links 1 Access
(0644/-rw-r--r--) Uid ( 1000/ geirs) Gid (
100/ users) Access 2005-01-01
200428.522950920 0100 Modify 2005-01-01
200540.556000232 0100 Change 2005-01-01
200540.556000232 0100
11Kort repetisjon
- Information about commands in UNIX
- man Explains a command.
- info As man but can give additional information
- apropos Searching for words in a file (database)
- which Gives the full path to a command if it is
in our PATH - Some commend are only described in README-files
12The command script
- Used to make a text file of what is happening in
a shell - script out logging all actions in the shell to
the file out - The logging terminates with Ctrl-d
- Example
13The command script
geirs_at_compaq/tmpgt cat out Script started on Thu
06 Jan 2005 082757 PM CET geirs_at_compaq/tmpgt
touch a geirs_at_compaq/tmpgt ls -l total
0 -rw-r--r-- 1 geirs users 0 2005-01-06 2029
a -rw-r--r-- 1 geirs users 0 2005-01-06 2027
out geirs_at_compaq/tmpgt chmod 755
a geirs_at_compaq/tmpgt ls -l total 0 -rwxr-xr-x 1
geirs users 0 2005-01-06 2029 a -rw-r--r-- 1
geirs users 0 2005-01-06 2027 out geirs_at_compaq/
tmpgt uname -a Linux compaq 2.6.4-52-default 1
Wed Apr 7 020830 UTC 2004 i686 i686 i386
GNU/Linux geirs_at_compaq/tmpgt /sbin/ifconfig eth0
Link encapEthernet HWaddr
0011252C7DC7 inet
addr128.39.89.35 Bcast128.39.89.255
Mask255.255.255.0 inet6 addr
fe8021125fffe2c7dc7/64 ScopeLink
UP BROADCAST MULTICAST MTU1500 Metric1
RX packets0 errors0 dropped0 overruns0
frame0 TX packets0 errors0 dropped0
overruns0 carrier0 collisions0
txqueuelen1000 RX bytes0 (0.0 b) TX
bytes0 (0.0 b) Base address0x8000
Memoryc0220000-c0240000 lo Link
encapLocal Loopback inet
addr127.0.0.1 Mask255.0.0.0 inet6
addr 1/128 ScopeHost UP LOOPBACK
RUNNING MTU16436 Metric1 RX
packets168 errors0 dropped0 overruns0
frame0 TX packets168 errors0
dropped0 overruns0 carrier0
collisions0 txqueuelen0 RX
bytes24235 (23.6 Kb) TX bytes24235 (23.6
Kb) geirs_at_compaq/tmpgt Script done on Thu 06
Jan 2005 084943 PM CET
14Other useful commands
- Sending a file from the shell
geirs_at_compaq/tmpgt mail -s "En fil"
john.doe_at_foo.com lt /etc/passwd
- Looking for a file and sending all error messages
into a black hole
geirs_at_compaq/tmpgt find / -name resolv.conf
-print 2gt/dev/null
- Hint Learn how to do combination of commands in
the shell, you will save time and learn. Remember
the manual.