1 / 29

CPSC 665 Spring 2004 Basic System Administration

CPSC 665 Spring 2004 Basic System Administration. Nolan Flowers. Agenda. Operating Systems Red Hat Linux Solaris Sources for information O’reilly Books Unix Power Tools 2 nd edition Linux Administration Handbook. Topics Covered. Useful commands Useful files Installing software.

ulani
Download Presentation

CPSC 665 Spring 2004 Basic System Administration

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CPSC 665 Spring 2004Basic System Administration Nolan Flowers

  2. Agenda • Operating Systems • Red Hat Linux • Solaris • Sources for information • O’reilly Books Unix Power Tools 2nd edition • Linux Administration Handbook

  3. Topics Covered • Useful commands • Useful files • Installing software

  4. Commands • find • ls • grep • ifconfig • netstat • chmod • chown • chgrp • adduser

  5. find • The Syntax for find is:

  6. ls • Action: • Command to list files • Syntax: • ls -<parameters> • Commonly user parameters are: • -al list all long format (includes files that start with .) • -l list long format (doesn’t include . Files) • -ald list all long format directories

  7. grep • Action: • Searches on a regular expression • Syntax: • grep <pattern> • ls’ best friend • ls –al | grep filename • Accepts wildcards

  8. ifconfig • Action: • Gives status on network interfaces • Syntax: • Ifconfig (-a for unix) • Returns MAC address, interface status, netmask, broadcast address, number of received and transmitted packets, etc

  9. netstat • Action: • Gives network status • Syntax: • netstat -<parameter> • Commonly used parameters • -nr lists routing table • -at lists active internet connections

  10. chmod • Action: • Changes permissions on files or directories • Syntax: • chmod mode file (chmod 777 thisfile)

  11. chown • Action: • Changes ownership of files or directories • Syntax: • chwon owner file (chown bubba thisfile)

  12. chgrp • Action: • Changes group ownership of a file or directory • Syntax: • chgrp groupname file (chgrp staff thisfile) • chown and chgrp can be aggragated: • chown user:group file (chown bubba:staff thisfile)

  13. adduser • Action: • command to add users • Syntax: • usage: adduser [-u uid [-o]] [-g group] [-G group,...] • [-d home] [-s shell] [-c comment] [-m [-k template]] • [-f inactive] [-e expire ] [-p passwd] [-M] [-n] [-r] name

  14. Important Files • /etc/password • /etc/shadow • /etc/group

  15. /etc/password • Sample /etc/password file bin:x:1:1:bin:/bin:/sbin/nologin daemon:x:2:2:daemon:/sbin:/sbin/nologin adm:x:3:4:adm:/var/adm:/sbin/nologin • One line per user each with seven fields • login name • Encrypted password (x indicates use of shadow file) • UID number • Default GID number • Full Name • Home directory • Login shell

  16. /etc/shadow • Sample /etc/shadow file bin:*:12333:0:99999:7::: daemon:*:12333:0:99999:7::: adm:*:12333:0:99999:7::: • One line per user each with nine fields • login name • Encrypted password • Date of last password change • Minimum number of days between password changes • Maximum “ • Number of days in advance to warn about password expiration • Number of days after expiration that account is disabled • Account expiration date • Reserve field that is always empty

  17. /etc/group • Sample /etc/group file wheel:*:10:root,joe,jim,john csstaff:*:100:bubba,sissy students:*:200:kim • One line per group each with four fields • Group name • Encrypted password (historical) • GID number • List of members, separated by a comma with no spaces

  18. Pitfalls & Cautions • Make sure the shell exists before modifying /etc/password • Don’t set UID to 0. Convenient, but a really bad idea. • Start group IDs higher than 100.

  19. Installing Software • wget • tar -xvfz • Dependencies • configure • make • make install

  20. wget • ftp, scp and http are methods of transfering data. • wget <link> establishes the connection and transfers the file in one easy step • Example: unix % wget http://mirror.ehpg.net/apache/httpd/httpd-2.0.48.tar.gz This will retrieve the apache source to your local directory

  21. tar • Most, if not all files come either tar’d or gzip (compressed) or both. • tar has no compression it is just a bundleing of files for ease of transfer. • To untar and uncompress at the same time use: • tar xvfz <filename> • x: extract • v: vervose • f: file • z: unzip

  22. Dependencies • A majority of software depends on other software to compile and run. • C is needed to compile the software (make) • To run https, pops or imaps you need ssl • To have php query databases, … etc. • Some package managers check dependencies and download them as needed.

  23. Configure • Configure is where you pass parameters to fine-tune your installation of the software. • Common parameters are: • Location (ie directories) • Security (openssl) • What modules to include

  24. make • This builds the program. • That is, make would be executed, it would look for the first target in Makefile and do what the instructions said. • The expected end result would be to build an executable program.

  25. make install • This again invokes make. • make finds the target install in Makefile and follows the directions to install the program. • Voila! Your program is compiled and installed.

  26. Installing Software • cd ./apache_1.3.29 • ./configure \ • --prefix=/usr/local/apache \ • --enable-module=so \ • --enable-module=rewrite \ • --enable-shared=rewrite \ • --enable-module=setenvif \ • . . . <parameters deleted for brevity> • --enable-shared=log_agent \ • --enable-module=headers \ • --enable-shared=headers • make • make install

  27. Installing Software • When make doesn’t • Things to consider when make fails: • Bad download of source code • Wrong parameters passed in configure • Things to remember: • Verify the checksum • Always do a ‘make clean’ prior to trying again

  28. Check the logs • When a program is not running as expected, the first place to look is the log files. • Log files either explicitly state the nature of the error or give excellent clues • If you compiled from source double check your dependencies. Since so many parameters can be passed to configure, errors are easy to make.

  29. Class Listserv • Class Listserv • 665-04@listserv.tamu.edu • Questions specifically for gold team • Only gold and platinum teams have access to read these e-mails • 665-04-gold@listserv.tamu.edu

More Related