/**************************************************/ /********** **********/ /********** linux esoterica & etc. **********/ /********** linux meetup 10-05-2009 **********/ /**** bob carnaghi, http://linux.meetup.com/85 ****/ /********** **********/ /**************************************************/ NOTE: this information was gathered and incorporated during a study of the Red Hat operating system as preparation notes for the Red Hat Certification Exam. The information collected here is due to change and evolve as it matures. It is offered free and clear as a starting point for your projects. No guarantees are offered; use at your own risk. /********** automounter **********/ the linux automounter is a method to mount nfs shares based upon demand when the mounted directory is accessed, it will be mounted after a specific amount of time of no access to the mounted directory, it will be unmounted config files: '/etc/sysconfig/autofs', note the following general directives #MASTER_MAP_NAME="auto.master" # change this for a non-default master file # # TIMEOUT - set the default mount timeout (default 600). # TIMEOUT=300 # sets the amount of time to unmount a non-accessed directory, five minutes in this case # '/etc/auto.*' - a compendium of files that configure various aspects of the automounter '/etc/auto.master' - the master configuration file; note the single example below '/misc /etc/auto.misc' - note that this directive in auto.master configures the automounting of the '/misc' directory '/etc/auto.smb' - an exectuable file that, when run, will show the smb mounts on the selected server '/etc/auto.net' - an executable file that, when run, will show the exports on the selected server, see example below root@bad-boy /etc/ --> ./auto.net server -fstype=nfs,hard,intr,nodev,nosuid \ /export/backup/inc-daily server:/export/backup/inc-daily \ 11:46:31 root@ic3225-00 /etc/ '/etc/auto.' - config file, as listed in '/etc/auto.master', that controls the specified directory, see below 11:46:31 root@ic3225-00 /etc/ --> cat auto.bak # # automounter set up for a&e cad ic mounts 07-24-2009 - bob carnaghi # students -ro,intr thresher:/mnt/export2/inc-daily/students staff -ro,intr thresher:/mnt/export2/inc-daily/staff share -ro,intr thresher:/mnt/export2/inc-daily/share automounter process 1. insert line @ '/etc/auto.master': {/dir /etc/auto.} 2. create '/etc/auto.' 3. enter mount options, typically follows the 'nfs' mount format/options (see '/etc/auto.misc for examples') `showmount -e remote-server` `service autofs {stop | stop | restart | reload | status}` /**************************************************/ /********* shared/collaborative directory *********/ creating a shared/collaborative directory: 1. create the shared directory ('//') 2. create the group and populate it with the users who are to write to the directory 3. set up ownership of the specified directory `chown nobody: //` 4. set permissions on w/sgid bit: `chmod 2770 //` 5. can (should?) also set the 'sticky bit': `chmod 3770 //` /**************************************************/ /********** disk quotas **********/ steps to enable quotas: need the 'quota' package installed enable use of quotas in the '/etc/fstab' file w/the 'usrquota,grpquota' options remount the filesystem: `mount -o remount ` (check result in the /etc/mtab file) key commands: `quotaon ` - enable quota support on the stated filesystem `quotaoff ` - disable quota tracking on the stated filesystem `edquota ` - manage the user quota settings `quota` - permits a user to view their quota settings `repquota [-a]` - generate a report of disk usage by users `quotacheck` - scans filesystem for quota usage, initialize the quota databases set up a user quota set up a group quota generate a quota report quotacheck in cron: '0 2 * * 6 /sbin/quotacheck -avug' /**************************************************/ /******** mount directive for acl & quota *********/ # line in 'etc/fstab' /dev/VolGroup00/LogVol06 /export ext3 defaults,usrquota,grpquota,acl 1 2 /**************************************************/ /********** acl **********/ setup acl (access control lists): configure filesystem at fstab w/'defaults,acl' remount filesystem set 'x' permission @ user home dir: `chmod 701 ` set facl perm @ user's home dir `setfacl -m user:bob:rwx /export/students/barnacleb` set facl mask @ user's home dir `setfacl -m mask:rwx /export/students/barnacleb` set facl perm @ user's dir-in-question `setfacl -m user:bob:r-x /export/students/barnacleb/pcbenv` set facl mask @ user's dir-in-question `setfacl -m mask:r-x /export/students/barnacleb/pcbenv` ??? set up individual file acl perms inside user home dir view acl status `setfacl` `getfacl` get acl status on specific file or dir: `getfacl ` /**************************************************/