190 likes | 270 Views
Learn how to create ISO images, mount them, utilize administrative tools, manage superuser access, implement sudo for selective command execution, communicate with users, and understand system tools. Explore examples specific to Linux and Unix systems.
E N D
Advanced Unix – 30 Aug 05 Administrative Tools
Creating an ISO Image • Create an ISO image • Place your textbook cd’s or dvd in the drive • As root create a directory mkdir /home/ISO • As root type the following to make image: dd if=/dev/cdrom of=/home/ISO/fc4-dvd.iso
Mounting the ISO Image • Make directory under the /mnt directory called iso • The you can mount the ISO image with: mount -o loop=/dev/loop1 -t iso9660 filename.iso /mnt/iso • To simplify this add the following line to /etc/fstab /home/ISO/fc4-dvd.iso /mnt/iso iso9660 loop=/dev/loop1,noauto
Administrative tools • Do you have a non-root account created? • If not, create one now, (as root) type: useradd <your id> • No add a password to the account: passwd <your id>
Administrative tools • Superuser root • Almost unrestricted access • Become a superuser • Log in to root • Use su or su – • Inherits the env from current shell • Only use superuser when it is needed • Change root password periodically • Employment status change for SA • Unauthorized access
Administrative tools • Lock your screen • Use xlock • Controlling access • System V • BSD – member’s of group 0 • Linux – GNU su does not check membership of group 0 • Terminal access control • Run a command with su same time • su root –c “command”
Administrative tools • Facility sudo • Selective access • Allow some user to run specific commands as root without having to know the root password • RUN sudo command • Type in user’s own password • Good for a configurable time, default 5 minutes • Configuration file /etc/sudoers • Users • Commands • Format Users host=commands
Administrative tools • More about Facility sudo • Select the commands for sudo with care • No shell scripts • No utility which provides shell escapes • Editor visudo • Lock • Syntax checking
Quick Demo of sudo • As a normal user type the following: /bin/cat /etc/sudoers • Now try the following: sudo /bin/cat /etc/sudoers • Now we add the following to /etc/sudoers <your id> ALL=/bin/cat /etc/sudoers • Now try step 2 again…
Administrative tools • Advantages • Command logging - accountabilities • Operators can do chores • Hide the real root password • Revoke the privilege without change root password • A list is maintained • Less chance of root shell left unattended
Administrative tools • More about Facility sudo • Disadvantage • Breach in security of a personal account = root account • Logging can be subverted • sudo csh • sudo su
Administrative tools • Communicating with Users • Command write • Write username [tty] • who • Rwho • Ctrl – D end it • Reply with write will create a two-way communication • Command talk • Separate window for sender and receiver • Disable message • Command mesg n • Root account can override the setting
Administrative tools • More about Communicating with Users • Sending message to all • Command wall • Very useful • The message of the Day • /etc/motd
Administrative tools • Administration tools • Examples: • Digital Unix: SETUP • HP-UX: SAM • Solaris: admintool • Good • Quick start to system administration • Raw commands • Easy: combine several steps • Downside • Type to command is faster • Not all commands available through menu • Slow down the learning process
Administrative tools • HP-UX’s SAM • Perform a variety of system management tasks • System configuration • Change a parameter • File system management • … • Detailed logging • System tools for Linux
Manuals • Unix has two types • Man pages • Individual commands • For format • Routines • Supplemental documents • Printed • online from Internet • DVD/CDROM • RFCs (Request for Comments) for protocols, standards used on the Internet
Manual • Man pages are kept • Under /usr/man/man# or /usr/share/man/man# • Format (troff, SGML) • Compressed (compress or gzip) • read manual pages: man • $man title • Example: $man ls • $man section title • Example: $man 4 tty • Solaris Example: $man –s 4 tty
Manual • More about reading manual pages: man • MANPATH • /etc/man.config • Add new man pages besides the system ones. Example: MANPATH=/home/share/localman:/usr/share/man export MANPATH • Keyword search in synopsis • $man –k keyword Example: $man –k mount