130 likes | 350 Views
Why Linux ?. Not-so-ancient history Torvalds, Linus Torvalds, 002 the Helsinki University, as a student, low budget, work home rapid and enthusiastic growth from toy to tool ported to almost anything from text mode servers to GUI desktops. Why Linux - continued. A few good reasons
E N D
Why Linux ? • Not-so-ancient history • Torvalds, Linus Torvalds, 002 • the Helsinki University, as a student, low budget, work home • rapid and enthusiastic growth from toy to tool • ported to almost anything • from text mode servers to GUI desktops
Why Linux - continued • A few good reasons • comes with its own sources: high degree of customization possible, most portable OS • stable server platform • wide range of support, from distributors and the community • leave the licensing adventure to the stronger-hearted
The Linux distribution (focus on Red Hat) • Basic OS components of a UNIX system • the kernel – the heart of the OS • system programs – implement the various services required from an operating system • application programs – get useful things done
The Linux distribution (focus on Red Hat) • The bootloader • Choice of alternative OS • Sends boot parameters to the kernel • GRUB vs LILO • User accounts, groups • Root account - no questions asked - careful
The Linux distribution (focus on Red Hat) • The filesystem (common) • Root directory: files that are necessary for booting the system • /root: The home directory for user root. This is usually not accessible to other users on the system • /usr: commands, libraries, manual pages, and user utilities • /var: files that change: spool directories, logs • /bin, /sbin: system programs • /home: users accounts home directories • /etc: system configuration files • /proc: system info • /dev: special device files for all the devices • /mnt: predefined mount point for devices
The Linux distribution (focus on Red Hat) • The package manager • What it does (as opposed to “make install”) • How it works, dependencies: • install • erase • upgrade • queries: finding installed packages, installed files • Rebuilding packages • spec files
Practical aspects - view open ports and check connections [root@bummer download]# netstat -atun Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 0.0.0.0:6000 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:7741 0.0.0.0:* LISTEN tcp 0 0 192.168.1.64:52479 83.140.65.8:80 ESTABLISHED tcp 0 0 192.168.1.64:50956 83.140.65.8:80 ESTABLISHED tcp 0 0 192.168.1.64:48980 83.140.65.8:80 ESTABLISHED tcp 0 0 192.168.1.64:39254 192.168.1.199:993 ESTABLISHED tcp 0 0 192.168.1.64:53081 216.155.193.157:5050 ESTABLISHED tcp 0 0 192.168.1.64:49203 217.74.209.135:5223 ESTABLISHED tcp 0 0 192.168.1.64:40836 192.168.1.63:3389 ESTABLISHED
Practical aspects - view open ports - continued • firewalls filter open ports; scan from another machine
Practical aspects – startup services • ntsysv lets you select system services to be started at boot time (for the current runlevel) • chkconfig –list (all runlevels)
Practical aspects – startup services (continued) – on demand services # less /etc/xinetd.d/ftp service ftp { socket_type = stream protocol = tcp wait = no user = root server = /usr/bin/ftpd disable = no only-from = 192.168.200.3 192.168.200.7 192.168.200.9 only-from += 192.168.200.10 192.168.200.12 172.16.0.0 no_access = 172.16.{1,2,3,10} access_times = 07:00-21:00 }
Practical aspects – check your system • find files modified within the last 24 hrs • find / -mtime 1 • spot largest files (numeric sort on 5th col) • ls –lR | sort +4n • find which process uses most memory • ps aux | sort +4n • Check available space • df -h
Practical aspects – the package manager • find packages containing string rpm –qa | grep string • find files installed by a package rpm –ql <package name> • find all files installed by Open Office packages rpm –ql $(rpm –qa| grep openoffice) | less • find all files installed by each package for i in $(rpm -qa | sort); do echo $i; rpm -ql $i; done
Practical aspects – patching the system • System updates • deal with • software bugs • vulnerabilities • dependency checking • up2date – use the source • apt, yum