1 / 12

System Administration

System Administration. Learning Objectives: To understand the procedure of using external storage medium in Unix System To learn the method of retrieving hardware’s information in Unix System To understand the method of setting up / managing user’s account in Unix System.

anne-cash
Download Presentation

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. System Administration Learning Objectives: To understand the procedure of using external storage medium in Unix System To learn the method of retrieving hardware’s information in Unix System To understand the method of setting up / managing user’s account in Unix System

  2. System Administration Table of Content • Using Floppies / CD-Rom (Sun) • Using Floppies / CD-Rom (Linux) • Disks • User Accounts • User Groups • Shutdown

  3. Using floppies/CDROM (Sun) • Preparing PC format diskette in a Sun computer $ fdformat -v -U -b myfiles Formatting 1.44 M in /vol/dev/rdiskette0/unformatted Press return to start formatting floppy. [ Return ] -v Verifies whether the diskette was formatted correctly. -U Unmounts the diskette if it is mounted. -e Ejects the diskette when done formatting. -b label Name for the diskette. (<= 8 characters) $ volcheck -v (detecting & mounting PC diskette/CDROM) • Preparing Sun format diskette (creating a file system) $ /usr/sbin/newfs -v /vol/dev/aliases/floppy0 (UFS) $ volrmmount -i floppy0 (UFS) • Ejecting media $ eject floppy0 $ eject cdrom0

  4. Using floppies (Linux) • Default mount options of file systems stored in /etc/fstab $ cat /etc/fstab LABEL=/ / ext2 defaults 1 1 LABEL=/data /data ext2 defaults 1 2 /dev/cdrom /mnt/cdrom iso9660 noauto,owner,ro 0 0 /dev/fd0 /mnt/floppy auto noauto,owner 0 0 none /proc proc defaults 0 0 none /dev/pts devpts gid=5,mode=620 0 0 /dev/hda5 swap swap defaults 0 0 • Mounting and dismounting a diskette (Linux) $ mount /dev/fd0 mount: block device /dev/fd0 is write-protected, mounting read-only $ ls /mnt/floppy install.bat readme.txt utility $ umount /dev/fd0 Device file name, mount point, file system type, mount options, dump opt, mount order If a diskette is write protected… umount removable device before taking them out to flush all data

  5. Using CDROM (Linux) • Usually CDROMs are in standard ISO9660 format and therefore readable in all computer systems (but probably not for floppies and hard disks file systems) $ mount /dev/cdrom $ ls /mnt/cdrom 95OR98.EXE INSTALLG.DOC README.TXT SETUP.FR VERSION.TXT $ eject

  6. Disks Usage Statistics • df display free blocks and # of files in each file system $ df | head /proc (/proc ): 0 blocks 934 files / (/dev/dsk/c0t3d0s0 ): 226544 blocks 280996 files /dev/fd fd ): 0 blocks 0 files /var (/dev/dsk/c0t3d0s3 ): 1480320 blocks 252851 files /cache (/dev/dsk/c0t3d0s4 ): 308472 blocks 243243 files /home (/dev/dsk/c0t3d0s7 ): 1408858 blocks 284098 files /tmp (swap ): 2903968 blocks 10169 files /var/mail(mail:/mail ):14054672 blocks 1097254 files /var/spool/uucp (mail:/var/spool/uucp): 3450734 blocks 350809 files • du display disk usage statistics (in number of 512k blocks) $ du | head -5 282 ./zmodem 14 ./gzip-0.7/msdos 2 ./gzip-0.7/os2 662 ./gzip-0.7 3626 ./mail du shows disk usage of directories in 512k blocks

  7. User Accounts (1) • Creating user accounts (root super-user only) useradd [-c comment] [-d home_dir] [-e expire_date] [-f inactive_time] [-g initial_group] [-G group[,...]] [-m [-k skeleton_dir] | -M] [-p passwd] [-s shell] [-u uid [ -o]] [-n] [-r] login useradd -D [-g default_group] [-b default_home] [-f default_inactive] [-e default_expire_date] [-s default_shell] $ su Password: $ useradd wujun • Viewing user account settings $ ypcat passwd | grep wujun wujun:##wujun:30152:1501:Wu_Jun,,=EXP.2001.07.31=DEMTER=PC.yes=RMACCESS.yes:/homes/wujun:/bin/tcsh -D changing defaults su change to another user (default= root)

  8. User Accounts (2) • Changing password (user may change own password) $ passwd john Changing password for user john New UNIX password: BAD PASSWORD: it is based on a dictionary word Retype new UNIX password: passwd: all authentication tokens updated successfully • Changing user account setting (super-user only) $ usermod usage: usermod [-u uid [-o]] [-g group] [-G group,...] [-d home [-m]] [-s shell] [-c comment] [-l new_name] [-f inactive] [-e expire ] [-p passwd] [-L|-U] name $ usermod -p secret john

  9. User Accounts (3) • Deleting a user account userdel [ -r ] login The userdel utility deletes a user's login from the system and makes the appropriate login-related changes to the sys- tem file and file system. OPTIONS The following options are supported: -r Remove the user's home directory from the system. This directory must exist. The files and direc- tories under the home directory will no longer be accessible following successful execution of the command. $ userdel john

  10. User Groups (1) • Adding a new group (super-user only) $ groupadd usage: groupadd [-g gid [-o]] [-r] [-f] group $ groupadd comp111 • Adding users to a group (super-user only) $ usermod -G comp111 kwchiu $ usermod -G comp111 john

  11. User Groups (2) • View users of a group $ ypcat group | grep comp111 comp111:*:40000:kwchiu,john usage: groupmod [-g gid [-o]] [-n name] group • Renaming a group (super-user only) $ groupmod usage: groupmod [-g gid [-o]] [-n name] group $ groupmod -n cs111 comp111 • Deleting a group $ groupdel usage: groupdel group $ groupdel cs111

  12. Shutdown • An executable shell script that calls the init program to shutdown the system. Recommended for servers because users are notified of the impending shut down as are the systems that are mounting resources from the server being shut down. Usage: /usr/sbin/shutdown [ -y ] [ -g grace-period ] [-i init-state ] [ message ] $ shutdown -i S -g 120 "===== disk replacement =====" Shutdown started. Tue Jun 7 14:51:40 PDT 1994 Broadcast Message from root (pts/1) on foo Tue Jun 7 14:51:41... The system will be shut down in 2 minutes ===== disk replacement ===== Broadcast Message from root (pts/1) on foo Tue Jun 7 14:52:41... The system will be shut down in 1 minutes ===== disk replacement ===== Broadcast Message from root (pts/1) on foo Tue Jun 7 14:53:41... The system will be shut down in 30 seconds ===== disk replacement ===== Do you want to continue? (y or n):

More Related