Presentation is loading. Please wait.

Presentation is loading. Please wait.

System Administration Learning Objectives: 1. To understand the procedure of using external storage medium in Unix System 2. To learn the method of retrieving.

Similar presentations


Presentation on theme: "System Administration Learning Objectives: 1. To understand the procedure of using external storage medium in Unix System 2. To learn the method of retrieving."— Presentation transcript:

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

2 COMP111 Lecture A2 / Slide 2 System Administration Table of Content  Using Floppies / CD-Rom (Sun)  Using Floppies / CD-Rom (Linux)  Disks  User Accounts  User Groups  Shutdown

3 COMP111 Lecture A2 / Slide 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 labelName 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 COMP111 Lecture A2 / Slide 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= /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 umount removable device before taking them out to flush all data If a diskette is write protected… Device file name, mount point, file system type, mount options, dump opt, mount order

5 COMP111 Lecture A2 / Slide 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 COMP111 Lecture A2 / Slide 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 ): blocks files /dev/fd fd ): 0 blocks 0 files /var (/dev/dsk/c0t3d0s3 ): blocks files /cache (/dev/dsk/c0t3d0s4 ): blocks files /home (/dev/dsk/c0t3d0s7 ): blocks files /tmp (swap ): blocks files /var/mail(mail:/mail ): blocks files /var/spool/uucp (mail:/var/spool/uucp): blocks files  du display disk usage statistics (in number of 512k blocks) $ du | head /zmodem 14./gzip-0.7/msdos 2./gzip-0.7/os2 662./gzip /mail du shows disk usage of directories in 512k blocks

7 COMP111 Lecture A2 / Slide 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 =DEMTER=PC.y es=RMACCESS.yes:/homes/wujun:/bin/tcsh -D changing defaults su change to another user (default= root)

8 COMP111 Lecture A2 / Slide 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 COMP111 Lecture A2 / Slide 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 COMP111 Lecture A2 / Slide 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 COMP111 Lecture A2 / Slide 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 COMP111 Lecture A2 / Slide 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):


Download ppt "System Administration Learning Objectives: 1. To understand the procedure of using external storage medium in Unix System 2. To learn the method of retrieving."

Similar presentations


Ads by Google