CISC 131.84 Introduction to UNIX (Red Hat Linux) ADMIN QUESTION SET Page 1 of 7 -------------------------------------------------------------------------- 1. Basic terms: ----------------------------------------------------------------------- | block | Minimum size of read/write to disk or tape. | –---------------------------------------------------------------------— | daemon | Background task owned by init (process 1). | –---------------------------------------------------------------------— | device filename | Pathname of a device -- usually in /dev. | –---------------------------------------------------------------------— | device | A physical computer hardware component. | –---------------------------------------------------------------------— | environment | The set of variable values used by a shell. | –---------------------------------------------------------------------— | filesystem | A data structure: superblock, inodes, data. | –---------------------------------------------------------------------— | fork | Create a process, synonym: spawn. | –---------------------------------------------------------------------— | kernel | Always in memory, allocates and controls | –---------------------------------------------------------------------— | login shell | Spawned when you log in. Spawns other processes.| -–------------------------------------------------------------------— | mount (a device) | Action that makes a device or filesystem usable.| –---------------------------------------------------------------------— | process | A program running in memory. | –---------------------------------------------------------------------— | root filesystem | A required filesystem that mounts all others. | –---------------------------------------------------------------------— | run level | Access permissions of a process. | –---------------------------------------------------------------------— | signal | A numeric value sent to a process via interrupt.| –---------------------------------------------------------------------— | spawn | Create a process, synonym: fork. | –---------------------------------------------------------------------— | system console | Main system terminal, usual destination/stderr. | –---------------------------------------------------------------------— | disk partition | A portion or slice of a disk - data or swap. | –---------------------------------------------------------------------— | X server | provides display for X applications. | ----------------------------------------------------------------------- 2. How is the System Administrator (superuser, root) different? ---------------------------------------------------------------------- | Some commands are restricted to superuser-only. | –--------------------------------------------------------------------— | Read and write file access permissions do not affect the superuser.| ---------------------------------------------------------------------- CISC 131.84 Introduction to UNIX (Red Hat Linux) ADMIN QUESTION SET Page 2 of 7 -------------------------------------------------------------------------- 3. How do you obtain superuser priviledges? ------------------------------------------------------------------------- | It is automatic when running in single-user mode. | –-----------------------------------------------------------------------— | Log in as root. | –-----------------------------------------------------------------------— | su (substitute user) to root. | –-----------------------------------------------------------------------— | The sudo utility is configurable to give limited superuser priviledge.| ------------------------------------------------------------------------- 4. Why would a system administrator use su to become anyone other than root? ----------------------------------------------------------------------- | To preserve individual and group ownership of files. -- Files | | created by root are owned by root. For example, if you create | | payroll files as superuser, then the accounting group would be | | unable to access them. | ----------------------------------------------------------------------- 5. How does single-user mode differ from multiuser mode? ---------------------------------------------------------------------- | Only the system console is enabled. | –--------------------------------------------------------------------— | Not all file systems are necessarily mounted. | –--------------------------------------------------------------------— | Single user mode is necessary for many maintenance tasks. | –--------------------------------------------------------------------— | You will need to execute sync manually to write changes to disk. | ---------------------------------------------------------------------- 6. Where are System Administrator tools usually stored. ---------------------- | /sbin | /usr/sbin | ---------------------- 7. How many inodes does a file have? What happens when you add a hard link to a file? What happens when you add a symbolic link? ------------------------------------------------------------------------- | 1 inode per file | –-----------------------------------------------------------------------— | hard link: a additonal reference to an inode in a single filesystem.| –-----------------------------------------------------------------------— | each filesystem has only one set of inodes. | –-----------------------------------------------------------------------— | symbolic links do not share an inode. | –-----------------------------------------------------------------------— | directories may also have symbolic links. | ------------------------------------------------------------------------- CISC 131.84 Introduction to UNIX (Red Hat Linux) ADMIN QUESTION SET Page 3 of 7 -------------------------------------------------------------------------- 8. What are the differences between a raw device and a block device? ------------------------------------------------------ raw: | direct i/o no buffering | ex:fsck –----------------------------------------------------— | 1 call, 1 r/w | –----------------------------------------------------— | device dependent restrictions on i/o | ------------------------------------------------------ ------------------------------------------------------ Block: | may perform random r/w | ex:normal i/o –----------------------------------------------------— | specific block size | –----------------------------------------------------— | one block at a time | –----------------------------------------------------— | whole blocks | –----------------------------------------------------— | can have a file system mounted on it | –----------------------------------------------------— | may have the kernel buffer as its input and output | –----------------------------------------------------— | appears to o/s as a series of blocks | ------------------------------------------------------ 9. How do you bring the system down? ------------------------------------------------------------------------- | /sbin/shutdown -t3 -rf The system will reboot in 3 minutes. | –-----------------------------------------------------------------------— | /sbin/shutdown -h 09:30 The system will halt at 09:30 | ------------------------------------------------------------------------- 10. What are some important files? ------------------------------------------------------------------------- | /dev/null | used to suppress output | –-----------------------------------------------------------------------— | cron.allow, cron.deny | restrict access to cron | –-----------------------------------------------------------------------— | at.allow, at.deny | restrict access to at | –-----------------------------------------------------------------------— | /etc/group | allows group access to files | –-----------------------------------------------------------------------— | /etc/mtab | lists mounted devices | –-----------------------------------------------------------------------— | /etc/motd | message of the day | –-----------------------------------------------------------------------— | /etc/pam.conf, /etc/pam.d/* | Plug and play authentication | –-----------------------------------------------------------------------— | /etc/passwd | passwords | –-----------------------------------------------------------------------— | /etc/profile | default bourne and Z shell config. | –-----------------------------------------------------------------------— | /etc/fstab | mount list on boot / fsck | –-----------------------------------------------------------------------— | /vmlinuz | standard name for linux kernel | ------------------------------------------------------------------------- CISC 131.84 Introduction to UNIX (Red Hat Linux) ADMIN QUESTION SET Page 4 of 7 -------------------------------------------------------------------------- 11. How often, and how much should you backup? ------------------------------------------------------------------------- | The more people on the system, the more often you should backup. | –-----------------------------------------------------------------------— | The book recommends a partial backup several times a day. | –-----------------------------------------------------------------------— | The book recommends a full backup several times a week. | –-----------------------------------------------------------------------— | It is a good idea to have offsite copies of backups. | ------------------------------------------------------------------------- 12. What programs can you use to perform backups? ------------------------------------------------------------ | tar | 'tape archive' | very common | –----------------------------------------------------------— | cpio | 'copy in-out' | accepts piped input | –----------------------------------------------------------— | afio | | can selectively compress | –----------------------------------------------------------— | tapir | | gui - stores relative/dir | ------------------------------------------------------------ 13. How do you schedule tasks with crontab? ---------------------------------------------------- | crontab submits commands to cron | –--------------------------------------------------— | - Minute Hour MonthDay Month Weekday command | –--------------------------------------------------— | - 1 1 * * * save | –--------------------------------------------------— | - 0 11 4 * mon-wed save | ---------------------------------------------------- 12. How do you schedule tasks with at? ----------------------------------------- | at runs things on a per-job basis | –---------------------------------------— | at 1 am Jul 31 save | ----------------------------------------- 13. How do you get information to users? ------------------------------------------------------------------------- | wall | writes to all terminals that have users logged in. | –-----------------------------------------------------------------------— | write, talk | communicates to individual terminals | –-----------------------------------------------------------------------— | Mail | goes to individuals, or lists | –-----------------------------------------------------------------------— | The Web | the world wide web | –-----------------------------------------------------------------------— | motd | when users log on, they see the message of the day. | –-----------------------------------------------------------------------— | news | selectively subscribed to by users. | ------------------------------------------------------------------------- CISC 131.84 Introduction to UNIX (Red Hat Linux) ADMIN QUESTION SET Page 5 of 7 -------------------------------------------------------------------------- 14. How do you add and remove user accounts? ------------------------------------------------------------------------- | useradd | command line | –-----------------------------------------------------------------------— | adduser | interactive | –-----------------------------------------------------------------------— | xusermgr | gui | –-----------------------------------------------------------------------— | userdel | deletes a user account, and his/her directories | ------------------------------------------------------------------------- 15. How do you monitor systems usage? ------------------------------------------------------------------------- | Watch for growing files such as log files and temporary files. | –-----------------------------------------------------------------------— | df - report on free disk space | –--------------------˜----------˜-----------------˜---------------------— | ps -l long format | -A/e all | -f full listing | -u username | –-------------------------------™-----------------™---------------------— | top - (linux) display cpu processes - interactive interface | | repetitive update formatted directly from kernel information.. | ------------------------------------------------------------------------- 16. How do you identify what processes a user is running? --------------------------------------------------------- | w - show who is logged on and what they are doing. | –-------------------------------------------------------— | ps -efu username | –-------------------------------------------------------— | ps -auw | grep username | grep -v grep | –-------------------------------------------------------— | ps -U | –-------------------------------------------------------— | find the user's UID from field 3 of /etc/passwd | --------------------------------------------------------- 17. Some useful utilities: ------------------------------------------------------- | chsh change a user's shell | –-----------------------------------------------------— | clear clears the screen | –-----------------------------------------------------— | reset resets default screen characteristics | –-----------------------------------------------------— | dmesg displays recent log messages | –-----------------------------------------------------— | ping tests network connections | –-----------------------------------------------------— | setserial configures a serial port | –-----------------------------------------------------— | uuname displays information about the system. | ------------------------------------------------------- CISC 131.84 Introduction to UNIX (Red Hat Linux) ADMIN QUESTION SET Page 6 of 7 -------------------------------------------------------------------------- 15. How do you mount and unmount filesystems? ------------------------------------------------------------------------- | The directory you mount them in must exist. | –-----------------------------------------------------------------------— | mount will fill in some missing arguments with info from /etc/fstab. | –-----------------------------------------------------------------------— | When you mount a filesystem in a directory that has files in it, | | they 'appear to disappear' afterwords. They are inaccessable | | because the directory inode now points elsewhere. When the | | filesystem is unmounted, they will 'reappear'. | –-------˜----------------------------------------------------------------— | mount | filesystem-type | device | directory | –-----------------------------------------------------------------------— | mount -t msdos /dev/fd0 /mnt/floppy | –-----------------------------------------------------------------------— | mount -t msdos /dev/hda1 /mnt/c: | –-----------------------------------------------------------------------— | mount -t ext2 /dev/hda3 /usr | ------------------------------------------------------------------------- 16.Where would a system administrator find primary technical support for unix? Who is the primary technical supporter of unix and linux? ------------------------------------------------------------------------- | AT&T SCO Hewlett Packard Digital Sun Microsystems | –-----------------------------------------------------------------------— | Red Hat Caldera Slackware Free BSD SuSE | –-----------------------------------------------------------------------— | www.linux.org www.redhat.com www.li.org www.linuxjournal.com | –-----------------------------------------------------------------------— | comp.os.linux.announce comp.os.linux.answers comp.os.linux.setup | –-----------------------------------------------------------------------— | comp.os.linux.hardware comp.os.linux.networking comp.os.linux.x | –-----------------------------------------------------------------------— | comp.os.linux.development.apps comp.os.linux.development.system | –-----------------------------------------------------------------------— | comp.os.linux.advocacy comp.os.linux.misc | –-----------------------------------------------------------------------— | comp.unix.* in netnews | –-----------------------------------------------------------------------— | plug - Philadelphia Linux Users Group: linux-list@ccil.org | | (Chris Fearnley) send mail here to join: | | linux-list-request@locke.ccil.org | | with a subject of SUBSCRIBE | ------------------------------------------------------------------------- 17. What is the command to start to upgrade UNIX? ---------------------------------------------------------------------- | It depends on what version. Some versions upgrade incrementally, | | even over the internet. (debian) Others must be reinstalled | | from scratch (slackware). Installation programs are particular to | | the distribution. | ---------------------------------------------------------------------- CISC 131.84 Introduction to UNIX (Red Hat Linux) ADMIN QUESTION SET Page 7 of 7 -------------------------------------------------------------------------- 18. How do you set default group and permissions for files as you create or modify them? -------------------------------------------------- | umask takes the complement of the permissions | | –------------------------------------------------— | umask 777 (no permissions) | -------------------------------------------------- 19. How can you identify the userid of another user on your system? ----------------------------------------------- | grep '^username:' /etc/passwd | cut -d: -f3 | ----------------------------------------------- 20. What steps does a system administrator do if a user cannot login? ------------------------------------------------- | confirm old is not working by trying to login | –-----------------------------------------------— | Check the terminal by logging on as yourself. | –-----------------------------------------------— | make sure the user's HOME dir exists | –-----------------------------------------------— | make sure the user owns his HOME directory. | –-----------------------------------------------— | verify the entry in /etc/passwd. | –-----------------------------------------------— | if it fails, logon as root | | and change the password with: passwd username | ------------------------------------------------- 21. How do you create a file that belongs to a specific group? ---------------------------------------------------------------- | chgrp groupname filename -- after the file exists | –--------------------------------------------------------------— or: | Become a member of that specific group and then create a file| ----------------------------------------------------------------