freebsd handbook中文版

Download FreeBSD Handbook中文版

If you can't read please download the document

Upload: api-3699761

Post on 07-Jun-2015

400 views

Category:

Documents


96 download

TRANSCRIPT

2

3

4 IP ) (USENET) (BBS) FreeBSD 386 PC RAIDXeon

5 3

3 386BSD Patchkit- Nate Williams Rod Grimes- 386BSD Patchkit bug 386BSD0.5 386BSD Interim -386BSD BillJolitz - Patchkit Bill Patchkit Bill Bill David Greenman FreeBSD FreeBSD Walnut Creek CDROM Walnut Creek CDROM FreeBSD Walnut Creek CDROM FreeBSD FreeBSD 1993 12 FreeBSD1.0 4.3BSD- Lite(Net/2) 386BSD (FSF) 1994 5 -FreeBSD1.1Novell U.C. Berkeley Berkeley Net/2 U.C. BerkeleyNet/2 Novell Novell AT&T Berkeley Novell 4.4BSD- Lite 4.4BSD- Lite Net/2 FreeBSD 1994 7 Net/2 - FreeBSD 1.1.5.1 BerkeleyCSRG4.4 Lite 4.4 Lite 1994 11 12 FreeBSD2.0 CDROM 1995 6 2.0.5 - 1996 8 FreeBSD2.1.5 -ISP 2.1- STABLE 1997 2 2.1.7.1 1996 11 - CURRENT FreeBSD 2.2 RELENG_2_2 1997 4 2.2.1 1997 2.2 1998 11 2.2.8 3.0 1998 10 1999 1 20 4.0- CURRENT 3.X - STABLE 3.X- STABLE 3.1 1999 2 15 3.2 1999 5 15 3.3 19999 16 3.4 1999 12 20 3.5 2000 6 24 6 35 3

2334 current- stable 4.0 2000 3 4.1 2000 7 4.2 2000 11 4.3 2001 4 4.4 2001 9 4.X- STABLE(RELENG_4) 2002 5.0- CURRENT trunk - ftp://current.freebsd.org/pub/FreeBSD/snapshots1.3.2FreeBSDFreeBSD GNU (GPL) LGPL GPL BSD 1.3.3FreeBSD FreeBSD FreeBSD - FreeBSD FreeBSD - FreeBSD 1 CVS FreeBSD CVS( )CVSFreeBSD CVS Santa Clara CVS - CURRENT - STABLE 19.3 FreeBSD CVS 2 CVS-FreeBSD commit CVS send- pr E_mail 3 FreeBSD FreeBSD FreeBSD -FreeBSD 7 22

- FreeBSD 4 FreeBSD FreeBSD FreeBSD www.FreeBSD.org FreeBSD 4 FreeBSD : 1.3.4FreeBSD FreeBSD 4.4BSD- Lite Intel i386 i486 Pentium Pentium Pro Celeron Pentium II Pentium III( )DEC Alpha U.C.BerkeleyCSRG NetBSDOpenBSD 386BSD1994 FreeBSD2.0 FreeBSD VM/file FreeBSD 5MB FreeBSD NIS TCP -PPP DHCPSCSI ISDNATMFDDI Adaptec - FreeBSD - FreeBSD - 5900 http(WWW) - 100MB - make install - CDROMFTP pkg_add 8

The FreeBSD Handbook file://localhost/usr/share/doc/handbook/index.html The FreeBSD FAQ file://localhost/usr/share/doc/faq/index.html FreeBSD http://www.FreeBSD.org/9

22

21

10 2 1

1 4 1 12 2 2114 01010100 3 56 1 222

223

1 386

165

100 250 350

2-1 4G -Windows C D 2G C 1GD 0.5G 11

2-24G -Windows Windows C 4G 1.5G FreeBSD2G FreeBSD 1 Windows Windows Windows 2G 2 Partition Magic Windows2 Alpha Alpha Alpha SCSI IDE SHOW DEVICE >>>show device dka0.0.0.4.0 DKA0TOSHIBA CD-ROM XM-57 3476 dkc0.0.0.1009.0DKC0RZ1BB-BS 0658 dkc100.1.0.1009.0DKC100SEAGATE ST34501W 0015 dva0.0.0.0.1 DVA0 ewa0.0.0.3.0 EWA000-00-F8-75-6D-01 pkc0.7.0.1009.0PKC0 SCSI Bus ID 7 5.27 pqa0.0.0.4.0 PQA0 PCI EIDE pqb0.0.1.4.0 PQB0 PCI EIDE Digital 433au 3 DKA0 CDROM DKC0 DKC100 DKx SCSI DKA100 1 SCSI A SCSI ID 1 SCSI DKC300 3 SCSI C SCSIID 3 SCSI PKx SCSI SCSICDROM SCSI DQx IDE PQ x IDE 2.2.4 FreeBSD FTP NFS 1 Cable/DSL Modem DSL 1 IP 2 IP 3 4 DNS IP ISP DHCP 2 Modem modem ISP FreeBSD 1 ISP 12 2 3 225

226

1 38644

2

3 E \>tools\fdimage floppies\kern.flp A .flp flpfoles CDROM FreeBSD FTP fdimage UNIX FreeBSD 13 # dd if=kern.flp of=/dev/fd0 FreeBSD /dev/fd0 A /dev/fd1 B UNIX 2.3 Last ChanceAre you SURE your want continue the installation? If you're running this on a disk with data you wish to save then WE STRONGLY ENCOURAGE YOU TO MAKE PROPER BACKUPS before proceeding! We can take no responsibility for lost disk contents! 2.3.1 1 i386 1 2 BIOS - F2F10 Del Alt+S Esc BIOS 3 CDROM CDROM 4 2.2.6 kern.flp CDROM CDROM a b BIOS 5 FreeBSD CDROM Verifying DMI Pool Data .............. Boot from ATAPI CD-ROM : 1. FD 2.88MBSystem Type-(00) /boot.config: -P Keyboard: yes BTX loader 1.00 BTX version is 1.01 Console: internal video/keyboard BIOS drive A: is disk0 BIOS drive B: is disk1 BIOS drive C: is disk2 BIOS drive C: is disk3 BIOS 639kB/64512kB available memory FreeBSD/i386 bootstrap loaderRevision 0.8 ([email protected] Nov 20 11:41:23 GMT 2000) 14 | Hit [Enter] to boot immediatelyor any other key for command prompt. Booting [kernel] in 9 seconds..._ Verifying DMI Pool Data ........ BTX loader 1.00 BTX version is 1.01 Console: internal video/keyboard BIOS drive A: is disk0 BIOS drive C: is disk1 BIOS 639kB/261120kB available memory FreeBSD/i386 bootstrap loaderRevision 0.8 ([email protected] Apr 21 08:46:19 GMT 2001) /kernel text=0x24f1bb data=0x307ac+0x2062c | Please insert MFS root floppy and press enter: kern.flp mfsroot.flp Enter6 CDROM Hit [Enter] to boot immediately or any other key for command prompt.Booting [kernel] in 9 seconds...... 10 Enter 2 Alpha 1 2 3 >>>BOOT DVA0 -FLAGS " -FILE " CDROM CDROM CDROM >>>BOOT DKA0 -FLAGS " -FILE " 4 FreeBSD Please insert MFS root floppy and press enter kern.flp mfsroot.flp Enter5 CDROM Hit [Enter] to boot immediately or any other key for command prompt. Booting [kernel] in 9 seconds..._ Enter 10 2.3.2 FreeBSD SCSI sa I/O com sio device probing PC15 PCI ISA IRQ IO DOS IRQ IO PCI - BIOS IRQ IO ISA IRQ IO 2.2.1 - IRQ FreeBSD FreeBSD FreeBSD - FreeBSD FreeBSD 2- 1 Start kernel configuration in full - screen visual mode 2-1 4 2- 21 active storage network IRQ CONF 2 - 16 2 2 3 4

1 2 3 2 317 2

0 00 3allowed conflict IRQ/ IRQ/ IRQ IO Enter Q - - 1 FreeBSD DIP DOS FreeBSD 4 2- 4 2-4 Q Save these parameters before exiting? ([Y]es/[N]o/[C]ancel) Y Sysinstall 2-5 18 2 5 233

2 6 avail memory = 58880000 (57500K bytes) Preloaded elf kernel "kernel" at 0xc065d000. md1: Malloc disk npx0: on motherboard npx0: INT 16 interface pcib0: on motherboard pci0: on pcib0 pcib1: at device 1.0 on pci0 pci1: on pcib1 pci1: at 0.0 irq 11 isab0: at device 7.0 on pci0 isa0: on isab0 atapci0: port 0xe000-0xe00f at device 7.1 on pci0 ata0: at 0x1f0 irq 14 on atapci0 uhci0: port 0xe400-0xe41f irq 10 at device 7.2 on pci0 usb0: on uhci0 usb0: USB revision 1.0 uhub0: VIA UHCI root hubclass 9/0rev 1.00/1.00addr 1 uhub0: 2 ports with 2 removableself powered chip1: at device 7.3 on pci0 fdc0: at port 0x3f0-0x3f5 0x3f7 irq6 drq2 on isa0 fdc0: FIFO enabled8 bytes threshold fd0: on fdc0 drive 0atkbdc0: at port 0x60-0x6f on isa0atkbd0: flags 0x1 irq 1 on atkbdc0kbd0 at atkbd0psm0: irq 12 on atkbdc0psm0: model Generic PS/2 mousedevice ID 0vga0: at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0 sc0: at flags 0x1 on isa0sc0: VGA sio0 at port 0x3f8-0x3ff irq 4 flags 0x10 on isa0sio0: type 16550Asio1 at port 0x2f8-0x2ff irq 3 on isa0sio1: type 16550Appc0: at port 0x378-0x37f irq 7 on isa0ppc0: SMC-like chipset (ECP/EPP/PS2/NIBBLE) in COMPATIBLE modeppc0: FIFO with 16/16/15 bytes thresholdppi0: on ppbus0lpt0: on ppbus0lpt0: Interrupt-driven portplip0: on ppbus0ad0: 8063MB [16383/16/63] at ata0-master using UDMA33ad2: 8063MB [16383/16/63] at ata1-master using UDMA33acd0: CDROM at ata0-slave using PIO4Mounting root from ufs:/dev/ad0s1aswapon: adding /dev/ad0s1b as swap deviceAutomatic boot in progress... /dev/ad0s1a: FILESYSTEM CLEAN; SKIPPING CHECKS/dev/ad0s1a: clean70119 free (655 frags8683 blocks0.7% fragmentation)/dev/ad0s1f: FILESYSTEM CLEAN; SKIPPING CHECKS/dev/ad0s1f: clean6976313 free (51774 frags829297 blocks0.7% fragmentation)/dev/ad0s1e: filesystem CLEAN; SKIPPING CHECKS/dev/ad0s1e: clean97952 free (9 frags12381 blocks0.0% fragmentation)63 Doing initial network setup: hostname.lo0: flags=8049 mtu 16384inet6 fe80::1%lo0 prefixlen 64 scopeid 0x8inet6 ::1 prefixlen 128inet 127.0.0.1 netmask 0xff000000Additional routing options: tcp extensions=NO IP gateway=YES TCP keepalive=YESrouting daemons:.additional daemons: syslogd.Doing additional network setup: portmap.Starting final network daemons: creating ssh RSA host keyGenerating RSA keys:Key generation complete.Your identification has been saved in /etc/ssh/ssh_host_key.Your public key has been saved in /etc/ssh/ssh_host_key.pub.The key fingerprint is:2d:02:37:d2:0e:68:93:8f:9c:46:de:92:f4:be:60:0a [email protected] creating ssh DSA host keyGenerating DSA parameter and key.Your identification has been saved in /etc/ssh/ssh_host_dsa_key.Your public key has been saved in /etc/ssh/ssh_host_dsa_key.pub.The key fingerprint is:38:af:d2:1f:63:14:00:d8:83:fd:dd:4b:97:1c:43:6d [email protected] ELF ldconfig path: /usr/lib /usr/lib/compat /usr/X11R6/lib /usr/local/libsetting a.out ldconfig path: /usr/lib/aout /usr/lib/compat/aout /usr/X11R6/lib/aoutstarting standard daemons: inetd cron sendmail sshd usbd.Initial rc.i386 initialization: Linux.rc.i386 configuring syscons: blank_time screensaver moused.Additional ABI support: Linux.Local package initilization:.Additional TCP options:.FreeBSD/i386(k6-2.example.com)(ttyv0) login: rprattPassword: RSA DSA X - startx2 FreeBSD Alpha FreeBSD>>>BOOT DKC0 FreeBSD >>>SET BOOT_OSFLAGS A >>>SET BOOT_FILE " >>>SET BOOTDEF_DEV DKC0 >>>SET AUTO_ACTION BOOT i386 2.9.18 FreeBSD Su Root shutdown-h now The operating system has halted.Please press any key to reboot. 64

210 386x86 Compaq AlphaIDE ESDI SCSIPCMCIA USB FreeBSDIBM MCA FreeBSD HARDWARE.TXTCDROM FTP sysinstall 2.11 FreeBSD MS- DOS2.11.1 PC 100% IRQ IODMA - - FreeBSD - sc0 - 1 2 3 IRQ DRQ IO Q FreeBSD 9 2.11.2 MS- DOS FreeBSD MS- DOS PC FreeBSD FreeBSD 1 MS- DOS FreeBSD FreeBSD FreeBSD FIPS FIPS 65

2

3 05 06 40 40 #mount -t msdos/dev/ad0s5/dos_d2.11.3 Alpha Alpha FreeBSD -1 ARC Alpha BIOS ? FreeBSD Compaq Tru64 VMS SRM 2 ? 3 Compaq Tru64 VMS ? 2.12 FreeBSD FreeBSD headlessinstall FreeBSD 1 I/O VGA floppies kern.flp mfsroot.flp2 kern.flp DOS copy DOS FreeBSD fdimage CDROM66 E:\>tools\fdimage floppies\kern.flp A .flp .flp CDROM fdimage FreeBSD FTP Unix dd FreeBSD # dd if=kern.flp of=/dev/fd0 FreeBSD /dev/fd0 A /dev/fd1 B UNIX 3 FreeBSD FreeBSD mount FreeBSD kern.flp # mount /dev/fd0 /mnt - # cd /mnt /boot/loader- h boot.config # echo "/boot/loader -h" > boot.config - umount # cd / # umount /mnt 4 modem null modem null modem 5 kern.flp 6 cu # cu -l /dev/cuaa0 - mfsroot.flp FreeBSD 67 213

Laplink- style FreeBSD2.13.1 FreeBSD FTP FreeBSD FTP FTP FreeBSD FTP FreeBSD CDROM /CDROM # mount/cdrom /etc/passwd FTP vipw - /etc/passwd ftp:*:99:99::0:0:FTP:/cdrom:/nonexistent /etc/inetd.conf FTP FTP ftp://your machine Internet FTP 2.13.2 1.44MB 1.2MB DOS MSDOS FORMAT Windows A: FreeBSD disklabel newfs UFS # fdformat -f 1440 fd0.1440 # disklabel -w -r fd0.1440 floppy3 68 # newfs -t 2 -u 18 -l 1 -i 65536 /dev/rfd0 5.25' fd0.1200 floppy5 1.44MB a:\bin\bin.aa a:\bin\bin.ab Floppy 2.13.3 MS- DOS MSDOS C C:\freebsd CDROMFTP DOSxcopy C:\> md c:\FreebSd C:\> xcopy e:\bin c:\FreeBSD\bin\ /s C:\> xcopy e:\manpages c:\FreeBSD\manpages\ /s C E CDROM CDROM ftp.freebsd.org bin 4.4/bin distributions MS - DOS ( ) c:\freebsd BIN 2.13.4 FTP CDROM # cd /freebsd/distdir # tar cvf /dev/rwt0 dist1 ...... dist2 - 2.13.5 SLIPPPP PLIP PCMCIA)SLIP support - hard- wired SLIP PPP SLIP MODEMPPP PAP CHAPISP ppp PPP modemAT commands69 162

2050

Permission Denied 70

33

31

71 -rw-rr-- rw- r-- r-- 644 FreeBSD FreeBSD /dev chmod 3.3 FreeBSD / mount point /usr /var /mnt /cdrom /etc/fstab /etc/fstab /etc/fstab rc noauto fstab /etc/fstab hier / /bin/ /boot/ /boot/defaults/ loader.conf /dev/ intro /etc/ /etc/defaults/ rc /etc/mail/ sendmail /etc/namedb/ named named /etc/periodic/ periodic /etc/ppp/ PPP ppp /mnt/ /proc/ procfs mount procfs /root/ root72

/sbin/ /stand/ /tmp/ /usr/ /usr/bin/ /usr/include/ C include/usr/lib/ /usr/libdata/ /usr/libexec/ /usr/local/ port Port /usr/local/share/doc/port /usr/obj/ /usr/src /usr/ports FreeBSD ports collection /usr/sbin/ /usr/share/ /usr/src/ /usr/X11R6/ X11R6 /var/ spool/var/log/ /var/mail/ /var/spool/ spooling/var/tmp/ /var/yp NIS 3.4 root / /dev /usr /usr/local - /var log/ spool/ / /var - NFS CDROM 3.4.1fstab 7 /etc/fstab /etc/fstab device /mount-point fstype options dumpfreq passno device 73 122 mount-point fstype FreeBSD ufsoptions rw ro noauto mount dumpfreq Passno 3.4.2 mount mount # mount device mountpoint mount-a /etc/fstab noauto- - t -d -v mount -f -r rdonly -o -t fstype -a ufs -u-v-w-o nodev noexec nosuid setuid setgid 3.4.3 umount umount -a - A -f74

35

1

% ps PIDTTSTAT TIME COMMAND 298p0Ss0:01.10 tcsh 7078p0S2:40.88 xemacs mdoc.xsl (xemacs-21.1.14) 37393p0I0:03.11 xemacs freebsd.dsl (xemacs-21.1.14) 48630p0S2:50.89 /usr/local/lib/netscape-linux/navigator-linux-4.77.bi 48730p0IW 0:00.00 (dns helper) (navigator-linux-) 72210p0R+ 0:00.00 ps 390p1Is 0:01.14 tcsh 7059p2Is+1:36.18 /usr/local/bin/mutt -y 6688p3IWs0:00.00 tcsh 10735p4IWs0:00.00 tcsh 20256p5IWs0:00.00 tcsh 262v0IWs0:00.00 -tcsh (tcsh) 270v0IW+0:00.00 /bin/sh /usr/X11R6/bin/startx -- -bpp 16 280v0IW+0:00.00 xinit /home/nik/.xinitrc -- -bpp 16 284v0IW 0:00.00 /bin/sh /home/nik/.xinitrc 285v0S0:38.45 /usr/X11R6/bin/sawfish ps PID ID PID 1 65536 PID TT tty STAT TIME CPU - CPU COMMAND Ps auxww A u X ww Top % top 75 last pid: 72257;load averages:0.13,0.09,0.03up 0+13:38:3322:39:10 47 processes:1 running, 46 sleeping CPU states: 12.6% user,0.0% nice,7.8% system,0.0% interrupt, 79.7% idle Mem: 36M Active, 5256K Inact, 13M Wired, 6312K Cache, 15M Buf, 408K Free Swap: 256M Total, 38M Used, 217M Free, 15% Inuse PIDUSERNAMEPRINICESIZERESSTATETIMEWCPUCPUCOMMAND 72257nik280 1960K1044KRUN0:0014.86%1.42%top 7078nik20 15280K10960Kselect2:540.88%0.88%xemacs-21.1.14 281nik20 18636K7112Kselect5:360.73%0.73%XF86_SVGA 296nik20 3240K1644Kselect0:120.05%0.05%xterm 48630nik20 29816K9148Kselect3:180.00%0.00%navigator-linu 175root20 924K252Kselect1:410.00%0.00%syslogd 7059nik20 7260K4644Kpoll1:380.00%0.00%mutt ... 5 PID - CPU ps PID CPU Top Netscape 30M 9MB Top s 3.6 - web email daemon Daemon web mail BSD - d BINDBerkeleyInternet named Apache web httpd lpd SENDMAIL sendmail maild signal signal signal signal signal Root signal FreeBSD FreeBSD Segmentation Violation signal (SIGSEGV) 76

12

web httpd SIGHUP signal kill signal signal inetd Inetd /etc/inetd.conf SIGHUP inetd 1 ID ps grep Grep inetd root ps ax % ps -ax | grep inetd 198?? IWs 0:00.00 inetd wW inetd PID 198 grepinetd ps 2 kill inetd root su root% su Password: # /bin/kill -s HUP 198 Unix kill signal kill: PID: Operation not permitted PID PID kill: PID: No such process /bin/kill shell kill shell /bin/kill shell init ID1 /bin/kill- sKILL1 Return kill 3.7ShellFreeBSD shell {}77

11

%setenv EDITOR/usr/local/bin/emacs Bourne shell %exportEDITOR="/usr/local/bin/emacs" $ echo $TERM $T ERM shell $TERM echo Shell meta -characters * meta -characters 78

shell chsh - s shell -shell shell bash % chsh -s /usr/local/bin/bash chsh - shell shell /etc/shells ports collection shell 4 shell bash /usr/local/bin # echo "/usr/local/bin/bash">>/etc/shells chsh3.8 - FreeBSD - - FreeBSD - ports collection - ee ee eefilename filename - - /etc/rc.conf ee /etc/rc.conf ee - ^ Crtl ^e Crtl e ee escape -FreeBSD - vi emacs vim - - vim emacs - 3.9 FreeBSD /var/run/dmesg.boot acd0 IDECDROM kbd0 Unix /dev 79

# cd /dev # sh MAKEDEV ad1 IDE devfs ( ) devfs Devfs devfs FreeBSD 5.0 3.10 3.10.1 FreeBSD man % man command command ls % man ls 1 2 3 C 4 5 6 7 8 9 chmod chmod man % man 1 chmod chmod chmod chmod chmod man80

% man -k mail mail apropos /usr/bin % cd /usr/bin % man -f * % cd /usr/bin % whatis * 3.10.2 GNU Info FreeBSD info info emacs emacs info info % info h ?81

44

41

82

ores packages ports 4.3 FreeBSD

83

# ftpa ftp2.freebsd.org Connected to ftp2.freebsd.org. 220 ftp2.freebsd.org FTP server (Version 6.00LS) ready. 331 Guest login ok, send your email address as password. 230- 230- This machine is in Vienna, VA, USA, hosted by Verio. 230- Questions? E-mail [email protected]. 230- 230- 230 Guest login ok, access restrictions apply. Remote system type is UNIX. Using binary mode to transfer files. ftp> cd /pub/FreeBSD/ports/packages/sysutils/irc 250 CWD command successful. ftp> get lsof-4.56.4.tgz local: lsof-4.56.4.tgz remote: lsof-4.56.4.tgz 150 Opening BINARY mode data connection for 'xchat-1.7.1.tgz' (92375 bytes). 100% |**************************************************|92375 00:00 ETA 226 Transfer complete. 92375 bytes received in 5.60 seconds (16.11 KB/s) ftp> exit # pkg_add lsof-4.56.4.tgz # package FreeBSDcdrom pkg_add -r FTP package# pkg_add r lsof-4.56.4

# pkg_delete xchat-1.7.1 84 443

# pkg_info cvsup-16.1A general network file distribution system optimized for CV docbook-1.2 Meta-port for the different versions of the DocBook DTD ... pkg_version package package ports # pkg_version cvsup= docbook = ... ports =portsports ?ports * 4.4.4 package /var/db/pkg package 4.5 Ports Collection ports collection 4.5.1 Ports Ports collection Ports collection Makefi le /usr/ports FreeBSD Sysinstall ports collection ports collectionSysinstall sysinstall ports collection1 root sysinstall# /stand/sysinstall 2 Configure Enter3 Distributions Enter4 Ports 5 Exit Enter85 67

6

CVSup Port Port CVSuP 1 net/cvsup A.6.2 2 root /usr/share/examples/cvsup/ports- supfile /root 3 -ports- supfile4 CHANGE_THIS.FreeBSD.org CVSup A.6.7 CVSup 5 cvsup # cvsup - g - L 2 /root/ports- supfile 6 - portscollection4.5. 2 Port Ports collection skeleton port skeleton FreeBSD port skeleton

Removeline10Changeline26tothis diffs diff port

whereis #whereislsof lsof: /usr/ports/sysutils/lsof 86

program- name lsof # cd /usr/ports # make search key=lsof Port: lsof-4.56.4 Path: /usr/ports/sysutils/lsof Info: Lists information about open files (similar to fstat(1)) Maint: [email protected] Index: sysutils B-deps: R-deps: Path: port : root port 1 CDROM port FreeBSD FreeBSD www.freebsdmall.com - /cdrom port port # cd /usr/ports/sysutils/lsof lsof port skeleton port make # make >> lsof_4.57D.freebsd.tar.gz doesn't seem to exist in /usr/ports/distfiles/. >> Attempting to fetch from file:/cdrom/ports/distfiles/. ===>Extracting for lsof-4.57 ... [extraction output snipped] ... >> Checksum OK for lsof_4.57D.freebsd.tar.gz. ===> Patching for lsof-4.57 ===> Applying FreeBSD patches for lsof-4.57 ===> Configuring for lsof-4.57 ... [configure output snipped] ... ===>Building for lsof-4.57 ... [compilation snipped] ... # port make install # make install ===>Installing for lsof-4.57 ... [install routines snipped] ... ===> Generating temporary packing list ===> Compressing manual pages for lsof-4.57 ===> Registering installation for lsof-4.57 ===>SECURITY NOTE: 87 This port has installed the following binaries which execute with increased privileges. # lsof port make install make make install port- cdrom - cdrom port 2 Internet port - Internet CDROM Internet port CDROM Internet CDROM # make install >>lsof_4.57D.freebsd.tar.gz doesnt seem to exist in /usr/ports/distfiles/. >>Attempting to fetch from ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/. Receiving lsof_4.57D.freebsd.tar.gz (439860 bytes): 100% 439860 bytes transferred in 18.0 seconds (23.90 kBps) ===> Extracting for lsof-4.57 ... [extraction output snipped] ... >> Checksum OK for lsof_4.57D.freebsd.tar.gz. ===> Patching for lsof-4.57 ===> Applying FreeBSD patches for lsof-4.57 ===> Configuring for lsof-4.57 ... [configure output snipped] ... ===> Building for lsof-4.57 ... [compilation snipped] ... ===> Installing for lsof-4.57 ... [install routines snipped] ... ===>Generating temporary packing list ===>compressing manual pages for lsof-4.57 ===>Registering installation for lsof-4.57 ===> SECURITY NOTE: This port has installed the following binaries which execute with increased privileges. # port port88 45 3

# cd /usr/ports/irc/lsof # make deinstall ===> Deinstalling for lsof-4.57 - lsof /usr/ports/irc/lsof make reinstall4.6 pkg_info FooPackage 1.0.0# pkg_info L foopackage-1.0.0 | less man/ etc/ doc/ # pkg_info | grep foopackage foopackage man # pkg_info foopackage-1.0.0 www: 4. 7 portscollection- port4.7.1 1 modem port Unix89 porting 2 patch patch delete line 23 add these two lines after line 468change line 197 to thisdiffs diff 3 tarball .tar .tar.gz .tar.Z .tar.bz2 .tgz - UNIX tar % tar tvzf foobar.tar.gz % tar xzvf foobar.tar.gz % tar tvf foobar.tar % tar xvf foobar.tar 4 checksum checksum -5 port kermit # make install >> cku190.tar.gz doesn't seem to exist on this system. >> Attempting to fetch from ftp://kermit.columbia.edu/kermit/archives/. port port Kermit Kermit tarball MASTER_SITES( Makefile) 6 /usr/ports/distfiles Port /usr/ports/distfiles tarball (symlink) # make DISTDIR=/where/you/put/it install 7 Port /usr/ports /u/people/guests/wurzburger PORTSDIR PREFIX port # make PORTSDIR=/u/people/guests/wurzburger/ports install /u/people/guests/wurzburger/ports port /usr/local # make PREFIX=/u/people/guests/wurzburger/local install /usr/ports port /u/people/guests/wurzburger/local # make PORTSDIR=.../ports PREFIX=.../local install ( ) imake X port P REFIX /usr/X11R6 Perl port PREFIX Perl port PREFIX 90

8

# cd /usr/ports # make fetch port tarball # cd /usr/ports/directory # make fetch - port9 FreeBSD MASTER_SITES port ftp.FreeBSD.org MASTER_ SITES # cd /usr/ports/directory # make MASTER_SITE_OVERRIDE=\ ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/ fetch 10 make make make fetch-list port11 port control-C make extract 12 port make extract make patch PATCH_DEBUG 13 - port gcc 2.6.3 FreeBSD 2 .1.0 2.1.5 -02 -fno-strength-reduce port -02 # make CFLAGS=-O2 -fno-strength-reduce install - /etc/make.conf port makeconfigure M akefiles M akefiles FreeBSD 14 port port /usr/ports INDEX portscollection LISP port % cd /usr/ports % make search key=lisp 91 15 foo bar bar foo port 16 port grizzle # pkg_delete grizzle-6.5 # cd /usr/ports/somewhere/grizzle # make deinstall 17 # pkg_info -I grizzle* Information for grizzle-6.5: grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shootem up arcade game. pkg_info ls /var/db/pkg18 port - # cd /usr/ports # make clean port port skeletons makefile # find /usr/ports -depth -name work -exec rm -rf {} \; 19 - tarball distfiles - make distclean 20 : # cd /usr/ports # make install port port /usr/local/bin/plot 21 port port Do you want to print on A4 US letter sized paper? 22 92 # cd /usr/ports # make -DBATCH install port # cd /usr/ports # make -DINTERACTIVE install 23 frobble package # cd /usr/ports/somewhere/frobble # make extract # cd work/frobble-2.8 [Apply your patches] # cd ../.. # make package 24 port /usr/ports/Mk bsd.port.mk bsd.port.subdir.mk shell4.7.2 Port port 1 Porter http://www.FreeBSD.org/porters-handbook/index.html Ports port port2 email port email SHELLmakemaintainer Makefileemail port send- pr 3 ftp ftp.freebsd.org Packages pkg_add 93

55

51 8686 86 118686

W Window X W XX X Window System X11 XWindows X 94 522 client- server X Xserver Server X xterm Netscape client client Please draw a window at these coordinates The user just clicked on your OK button FreeBSD X server X client FreeBSD X server X X server X client X X server X client X server X client client server Microsoft Windows Apple MacOSX X FreeBSD Xserver XFree86 FreeBSD- FreeBSD X server5.2.3 X Unixtools notpolicy X X AfterStep Blackbox Enlightenment ctwm ftwm sawfish twm WindowMaker start themeable Ports Collectionx11- wm KDE GNOME GUI sawfish lisp click- to- focus Microsoft Windows X 95

524

widget buttons check boxes radio buttons icons listsMicrosoft Windows MicrosoftWindows AppleMacOS X X Athena(MIT ) Motif openlook X Qt KDE GTKGNOME UNIX 5.3 XFree86XFree86 XFree86 3.XXFree86 - XFree86 4.X 3.X 4.X FreeBSD XFree863.3.6 2.9.11 XFree864.X FreeBSD XFree86 ports collection XFree86 4.X # cd /usr/ports/x11/XFree86-4 # make all install clean 96 86 4 86 86 8654 86 541 86 4

# XFree86 configure XF86Config.new skeleton XFree86 XFree86 XFree86 # XFree86 -xf86config XF86Config.new X ctrl+alt+backspace XF86Config.new emacs ee - XF86Config.new Monitor Section "Monitor" Identifier "Monitor0" VendorName "Monitor Vendor" ModelName"Monitor Model" Horizsync30-107 VertRefresh48-120 EndSection Horizsync VertRefresh Horizsync VertRefresh - 97 86 Section "Screen" Identifier "Screen0" Device "Card0" Monitor"Monitor0" DefaultColorDepth 24 SubSection "Display" Depth24 Modes"1024x768" EndSubSection EndSection DefaultColorDepth Modes 24 1024 768 24 1024 768 DefaultColorDepth 24 Display VESA XFree86 /etc/X11/XF86Config /usr/X11R6/etc/ X11/XF86Config. # cp XF86Config.new /etc/X11/XF86Config startx XFree86 4.X X11/wrapper port XFree86 4.X xdm 5.4.3 Intel i810 Inteli810 XFree86 AGP kldload agp.ko loader /boot/loader.conf agp_load="YES" AGP /dev MAKEDEV # cd /dev # sh MAKEDEV agpgart 5.5 XFree86 5.5.1 Type1 XFree86 netscape Type1 XFree86 version3.X version4.X URW x11 -fonts/urwfonts type1 (Times Roman Helvetica Palatino ) freefont x11 -fonts/freefonts 98 861 # cd /usr/ports/x11-fonts/urwfonts # make install clean Freefont X XF86Config XFree86 3 /etc/ 4 /etc/X11/ FontPath "/usr/X11R6/lib/X11/fonts/URW/" % xset fp+ /usr/X11R6/lib/X11/fonts/URW % xset fp rehash 5.5.2 Truetype XFree86 4.x - Truetype freetype freetype /etc/X11/XF86Config Loadfreetype XFree86 3.3.x Truetype Xfstt xfstt port x11-servers/Xfstt Truetype Truetype Macintosh U nix/DOS/Windows ttmkfdir fonts.dir X - ttmkfdir /usr/ports/x11 -fonts/ttmkfdir # cd /usr/X11R6/lib/X11/fonts/Truetype # ttmkfdir > fonts.dir Truetype Type1 % xset fp+ /usr/X11R6/lib/X11/fonts/Truetype % xset fp rehash FontPath XF86Config Netscape Gimp StarOffice X - Truetype Web Staroffice -5.5.3 Anti - Aliased XFree86 4.0.2 anti-aliased QT KDE - XFree864.0.2 Qt2.3 KDE KDE/Qt anti-aliased anti-aliasing /usr/X11R6/lib/X11/XftConfig Xserver anti-aliased 99 dir "/usr/X11R6/lib/X11/Type1" URW Truetype anti-aliased Anti-aliasing Type1 Truetype bitmap XF86Config Antialiasing 9 13 match any size > 8 any size < 14 edit antialias = false; anti-aliasing KDE 100 match any family == "fixed"edit family =+ "mono"; match any family == "console"edit family =+ "mono"; mono match any family == "mono" edit spacing = 100; Lucidux match any family == "mono"edit family += "LuciduxMono"; match any family == "Lucidux Mono"edit family += "LuciduxMono"; match any family == "LuciduxMono" edit family =+ "Lucidux Mono"; family .xftconfig includeif"~/.xftconfig" LCD xftconfig match edit rgba=rgb; bgr vrgb vbgr anti-aliasing Qt - KDE anti-aliased gtk+ gtk+ GNOME Mozilla anti-aliased x11/gdkxft port anti-aliased 5.7.1 FreeBSD XFree86 Anti-aliasing 100 56 561

X X X X - X XDM XDM getty XDM X XDM - XDM 5.6.2 XDM XDM /usr/X11R6/bin/xdm root X - XDM /etc/ttys 15.3.2.1 XDM /etc/ttys ttyv8"/usr/X11R6/bin/xdm -nodaemon"xterm offsecure 5 off on init ttyv8 XDM 9 5.6.3 XDMXDM /usr/X11R6/lib/X11/xdm XDM Xaccess Xresources X Xservers Xsession Xsetup_*xdm-config xdm-errors xdm-pidXDM ID XDM xdm Login 101 Password XDM XaccessXDM - X -XDMCP XDMCP xdm- config Xresources XFree86 Xservers Xsession XDM ~/.xsessionrcXsetup_* Xsetup_ Xsetup_0 xconsolexdm- config xdm- errors XDMX server XDM - ~/.xsession- errors 5.6.4 - XDM xdm- config ! SECURITY:do not listen for XDMCP or Chooser requests ! Comment out this line if you want to manage X terminals with xdm DisplayManager.requestPort0 XDM ! # Xaccess xdm 5.6.5 XDM XDM - KDMKDE KDM 5.7 FreeBSD X desktop environment102

5711

2 2Desktop Configuration package ports collection GNOME # pkg_add -r gnome GNOME port # cd /usr/ports/x11/gnome # make install clean GNOME X Server GNOME - .xinitrc /usr/X11R6/bin/gnome - session # echo "/usr/X11R6/bin/gnome-session" > ~/.xinitrc startx GNOME - XDM .xsession - /usr/X11R6/bin/gnome -session # echo "#!/bin/sh" > ~/.xsession # echo "/usr/X11R6/bin/gnome-session" >> ~/.xsession # chmod +x ~/.xsession KDE2 KDE kdm GNOME Anti- aliased anti- aliased XFree86 KDE GNOMEgtk libgdkxft x11/gdkxft port port /usr/X11R6/share/doc/gdkxft/README gtk libgdk.so libgdkxft Bourne shell(/bin/sh) shell Gimp % LD_PRELOAD=/usr/X11R6/lib/libgdkxft.so gimp csh shell % setenv LD_PRELOAD /usr/X11R6/lib/libgdkxft.so % gimp 103 LD_PRELOAD=/usr/X11R6/lib/libgdkxft.so export LD_PRELOAD .xinitrc .xsession /usr/X11R6/lib/X11/xdm/Xsession X linux Gtk 5.7.2 KDE21 KDE2KDE KDE KParts KDEUnix Web Konqeuror KDEwww.kde.org2 KDE2GNOME KDE FreeBSD Desktop Configuration packages ports collection KDE2 # pkg_add -r kde2 KDE port # cd /usr/ports/x11/kde2 # make install clean KDE2 X server - .xinitrc # echo "/usr/X11R6/bin/startkde" > ~/.xinitrc startx X -window KDE2 xdm - .xsession kdm 5.7.3 KDE2 KDE2 - Windows Mac KDE KDE web Konqueror 104 1 2

2 system Login manager KDE sessions New type KDE GNOME startkde gnome- session failsafe Apply KDM(KDE GNOME) -xdm KDE2.2 kdm KDE2.2 root - /usr/X11R6/lib/X11/xdm/Xsession case $# in 1) case $1 in failsafe) exec xterm -geometry 80x24-0-0 ;; esac esac KDE2 GNOME case $# in 1) case $1 in KDE2) exec /usr/X11R6/bin/startkde ;; GNOME) exec /usr/X11R6/bin/gnome-session ;; failsafe) exec xterm -geometry 80x24-0-0 ;; esac esac KDE /usr/X11R6/lib/X11/xdm/Xsetup_0 /usr/X11R6/bin/kdmdesktop kdm /etc/ttys xdm /usr/local/bin/kdm2 Anti -aliased KDE 4.0.2 XFree86 RENDER anti- aliasing 2.3 105 115532 2 Use Anti- Aliasing for Fonts and Icons KDEQt QT_XFTtrue5.7.4XFCE1 XFCEXFCEGNOME GTK toolkit Unix CDE XFCE

# pkg_add -r xfce ports collection: # cd /usr/ports/x11-wm/xfce # make install clean X X XFCE # echo "/usr/X11R6/bin/startxfce" > ~/.xinitrc X XFCE xdm /usr/X11R6/bin/startxfce .xsession GNOME kdm 108

66

61

109

1 23 2 Swap 128 M256MB 256MB VM VM SCSI IDE 4 UNIX 3 /usr /var /var/tmp I/O I/O /var 6.3 /etc/rc.conf rc* rc.conf /etc/defaults/rc.conf /etc rc.conf 110

.rc.conf.site hostname="node15.example.com" network_interfaces="fxp0 lo0" ifconfig_fxp0="inet 10.1.1.1" defaultrouter="10.1.1.254" saver="daemon" blanktime="100" rc.conf.site rsync rc.conf sysinstall make world rc.conf 6.4 package /usr/local/etc port package .default .default /usr/local/etc/apache -rw-r-r--1 rootwheel 2184 May 201998 access.conf -rw-r-r--1 rootwheel 2184 May 201998 access.conf.default -rw-r-r--1 rootwheel 9555 May 201998 httpd.conf -rw-r-r--1 rootwheel 9555 May 201998 httpd.conf.default -rw-r-r--1 rootwheel12205 May 201998 magic -rw-r-r--1 rootwheel12205 May 201998 magic.default -rw-r-r--1 rootwheel 2700 May 201998 mime.types -rw-r-r--1 rootwheel 2700 May 201998 mime.types.default -rw-r-r--1 rootwheel 7980 May 201998 srm.conf -rw-r-r--1 rootwheel 7933 May 201998 srm.conf.default srm.conf apacheport 6.5 ports packagescollection /usr/local/etc/rc.d start stop root package package /usr/local/etc/rc.d 111 #!/bin/sh echo -n ' FooBar' case "$1" in start) /usr/local/bin/foobar ;; stop) kill -9 'cat /var/run/foobar.pid' ;; *) echo "Usage: 'basename $0' {start|stop}" >&2 exit 64 ;; esac exit 0 start stop /usr/local/etc/rc.d/FooBar.sh chmod # chmod 755 FooB ar.sh inetd POP IMAP - /etc/inetd.conf inetd - /etc/rc.conf /etc/rc.local FreeBSD3.1 /etc/rc.local rc.local /etc/rc.conf /usr/local/etc/rc.d cron cron cortab root cron @reboot cron 6.6 FreeBSD real alias /etc/rc.conf fxp0 ifconfig_fxp0_alias0="inet xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx" alias0 _alias1 _alias2 112 1

0 10110255255255020207516255255255240 10111 101152020751720207520

ifconfig_fxp0="inet 10.1.1.1 netmask 255.255.255.0" ifconfig_fxp0_alias0="inet 10.1.1.2 netmask 255.255.255.255" ifconfig_fxp0_alias1="inet 10.1.1.3 netmask 255.255.255.255" ifconfig_fxp0_alias2="inet 10.1.1.4 netmask 255.255.255.255" ifconfig_fxp0_alias3="inet 10.1.1.5 netmask 255.255.255.255" ifconfig_fxp0_alias4="inet 202.0.75.17 netmask 255.255.255.240" ifconfig_fxp0_alias5="inet 202.0.75.18 netmask 255.255.255.255" ifconfig_fxp0_alias6="inet 202.0.75.19 netmask 255.255.255.255" ifconfig_fxp0_alias7="inet 202.0.75.20 netmask 255.255.255.255" 6.7 6.7.1 /etc /etc /etc/defaults /etc/mail sendmail MTA /etc/ppp ppp /etc/namedb named /var/db/usr/local/etc /usr/local/etc/rc.d //var/db : named 6.7.2 /etc/resolv.conf/etc/resolv.conf FreeBSD internet DNS resolv.confnameserver IP search domain resolv.conf search foobar.com nameserver 147.11.1.11 nameserver 147.11.100.30 DHCP dhclient DHCP resolv.conf/etc/hosts/etc/hosts DNS NIS 113

# $FreeBSD$ # # Host Database # This file should contain the addresses and aliases # for local hosts that share this file. # In the presence of the domain name service or NISthis file may # not be consulted at all; see /etc/nsswitch.conf for the resolution order. # # ::1localhost localhost.my.domain myname.my.domain 127.0.0.1 localhost localhost.my.domain myname.my.domain # # Imaginary network. #10.0.0.2 myname.my.domain myname #10.0.0.3 myfriend.my.domain myfriend # # According to RFC 1918you can use the following IP networks for # private nets which will never be connected to the Internet: # #10.0.0.0-10.255.255.255 #172.16.0.0-172.31.255.255 #192.168.0.0 -192.168.255.255 # # In case you want to be able to connect to the Internetyou need # real official assigned numbers.PLEASE PLEASE PLEASE do not try # to invent your own network numbers but instead get one from your # network provider (if any) or from the Internet Registry (ftp to # rs.internic.netdirectory '/templates'). # /etc/hosts [Internet address] [offical hostname] [alias1] [alias2] ... : 10.0.0.1 myRealHostname.foobar.com myRealHostname foobar1 foobar2 hosts 6.7.3 syslog.confSyslog.conf syslogd syslog # $FreeBSD$ # #Spaces ARE valid field separators in this file. However#other *nix-like systems still insist on using tabs as field #separators. If you are sharing this file between systemsyou #may want to use only tabs as field separators here. #Consult the syslog.conf (5)manual page. *.err;kern.debug;auth.notice;mail.crit/dev/console *.notice;kern.debug;lpr.info;mail.crit;news.err /var/log/messages security.*/var/log/security mail.info/var/log/maillog 114 lpr.info /var/log/lpd-errs cron.* /var/log/cron *.errroot *.notice;news.err root *.alertroot *.emerg* # uncomment this to log all writes to /dev/console to /var/log/console.log #console.info /var/log/console.log # uncomment this to enable logging of all log messages to /var/log/all.log #*.*/var/log/all.log # uncomment this to enable logging to a remote loghost named loghost #*.*@loghost # uncomment these if you're running inn # news.crit /var/log/news/news.crit # news.err /var/log/news/news.err # news.notice /var/log/news/news.notice !startslip *.*/var/log/slip.log !ppp *.* /var/log/ppp.log syslog.confnewsyslog.conf Newsyslog.conf newsyslog cron newsyslog Logfile logfile.0 logfile.0 logfile.1 gzip logfiel.0.gz logfile.1.gz newsyslog.conf # configuration file for newsyslog # $FreeBSD$ # # filename[owner:group] mode count size when [ZB] [/pid_file] [sig_num] /var/log/cron 6003 100*Z /var/log/amd.log 6447 100*Z /var/log/kerberos.log6447 100*Z /var/log/lpd-errs6447 100*Z /var/log/maillog 6447 *@T00Z /var/log/sendmail.st64410 * 168 B /var/log/messages6445 100 *Z /var/log/all.log 6007 * @T00Z /var/log/slip.log6003 100*Z /var/log/ppp.log6003 100*Z /var/log/security60010 100*Z /var/log/wtmp6443 * @01T05B /var/log/daily.log 6407 * @T00Z /var/log/weekly.log6405 1 $W6D0 Z /var/log/monthly.log 64012 * $M1D0 Z /var/log/console.log6405 100*Z newsyslog 6.7.4 sysctl.conf Sysctl.conf rc.conf variable=value sysctl.conf signal linux 115

kern.logsigexit=0 # Do not log fatal signal exits (e.g. sig 11) compat.linux.osname=FreeBSD compat.linux.osrelease=4.3-STABLE 6.8 sysctl sysctl FreeBSD TCP/IP - Sysctl 5 sysctl % sysctl -a kern.maxproc: % sysctl kern.maxproc kern.maxproc: 1044 variable= value # sysctl kern.maxfiles=5000 kern.maxfiles: 2088 -> 5000 Sysctl 1 yes 0 no6.9 6.9.1Sysctl vfs.vmiodirenable vfs.vmiodirenablesysctl 0 off 1 on 0 off 1k 512bytes VM 512 bytes 4K web hw.ata.wc FreeBSD IDE IDE IDE hw.ata.wcsysctl IDE 1 116 692 # tunefs -n enable /filesystem # tunefs -n disable /filesystem tunefs softupdates SoftUpdates SoftUpdates SoftUpdates SoftUpdates 1 SoftUpdates make installworld 6.10 6.10.1 kern.maxfiles kern.maxfiles file: table is full dmesg fifo kern.maxfile MAXUSERS MAXUSERS kern.maxfiles 256 web 6.10.2NMBCLUSTERS mbuf mbuf FreeBSD cluster 2K 1024 cluster 2MB 1000 16K 16K 32MB web 2 NMBCLUSTERS 2 32 MB / 2 KB=64MB/2K =327686.11 117 3 6111

6112 440 6113640 1pseudo-device vn 1 #Vnode driver (turns a file into a device) 2 vn-device # cd /dev # sh MAKEDEV vn0 3 # dd if=/dev/zero of=/usr/swap0 bs=1024k count=64 4 # chmod 0600 /usr/swap0 5 /etc/rc.confswapfile="/usr/swap0"6 # vnconfig e /dev/vn0b /usr/swap0 swap 118

1 bootstrapprocess booting FreeBSD FreeBSD init

bootingx86 BIOS BIOS MBR BIOS MBR MBR MBR MBR slice slice 119

3 1 2 331 0 0 012 110 F1DOS F2FreeBSD F3Linux F4?? F5Drive 1 Default: F2 Windows 95 MBR MBR MBR FreeBSD MBR # fdisk -B -b /boot/boot0 device device IDE ad0 IDE ad2 SCSI da0 7.3.2 1 /boot/boot1, 2 /boot/boot 2 1 2 slice /boot FreeBSD Boot1 512 FreeBSD boot2 Boot2 FreeBSD Loader boot2 120 22 >> FreeBSD/i386 BOOT Default: 0:ad(0,a)/kernel boot: boot1 boot2 disklabel # disklabel -B diskslice diskslice slice ad0s1 IDE slice disklabel ad0 slice RETURN disklabel 7.3.3 3 /boot/loader loader /boot/loader Loader 1 Loader loader /boot/loader.rc /boot/defaults/loader.conf /boot/loader.conf Loader.rc 10 loader 2 Loader autoboot seconds 10boot [- options] [kernelname] boot- conf unload kernel help [topic] /boot/loader.help (topic) index include filename ... inlucde load [- t type] filenamekernel kernel 121

3

boot -s unload load kernel.old kernelkernelkernelold kernel-kernel - kernel unload set kernel=" kernel.old" boot-conf

load -t userconfig_script/boot/kernel.conf loaderbootloader

-a 122 -C CDROM -c UserConfig -s-v 7.5 Init init /sbin/init loader init_path7.5.1 fsck init 7.5.2 -s loader boot_single shutdown -h insecure root 7 - 3 /etc/ttys insecure # namegettytype statuscomments # # This entry needed for asking password when init goes to single-user mode # If you want to be asked for password, change " secure" to "insecure" here console noneunknown off insecure insecure insecure root insecure insecure secure 7.5.3 init /etc/defaults/rc.conf /etc/rc.conf /etc/fstab (daemon) script rc 123

124

88

81

125

0 65536

83

126 84

85

86

861 dotfiles - adduser- s- config_create root adduser 8- 1adduser # adduser -v Use option "-silent" if you dont want to see all warnings and questions. 127 Check /etc/shells Check /etc/master.passwd Check /etc/group Enter your default shell: csh date no sh tcsh zsh [sh]: zsh Your default shell is: zsh -_ /usr/local/bin/zsh Enter your default HOME partition: [/home]: Copy dotfiles from: /usr/share/skel no [/usr/share/skel]: Send message from file: /etc/adduser.message no [/etc/adduser.message]: no Do not send message Use passwords (y/n) [y]: y Write your changes to /etc/adduser.conf? (y/n) [n]: y Ok, lets go. Dont worry about mistakes. I will give you the chance later to correct any input. Enter username [a-z0-9_-]: jru Enter full name []: J. Random User Enter shell csh date no sh tcsh zsh [zsh]: Enter home directory (full path) [/home/jru]: Uid [1001]: Enter login class: default []: Login group jru [jru]: Login group is "jru". Invite jru into other groups: guest no [no]: wheel Enter password []: Enter password again []: Name: jru Password: **** Fullname: J. Random User Uid: 1001 Gid: 1001 (jru) Class: Groups: jru wheel HOME: /home/jru Shell: /usr/local/bin/zsh OK? (y/n) [y]: y Added user "jru" Copy files from /usr/share/skel to /home/jru Add another user? (y/n) [y]: n Goodbye! # shell zsh ports collection shell- jru jru wheel su root adduser - s 8.6.2 rmuser rmuser rmuser 1 crontab 2 at 3 128 4 5 6 7 8

rmuser 8- 2 # rmuser jru Matching password entry: jru:*:1000:1000::0:0:J. Random User:/home/jru:/usr/local/bin/tcsh Is this the entry you wish to remove? y Remove user's home directory (/home/jru)? y Updating password file updating databases done. Updating group file: trusted (removing group jru--personal group is empty) done. Removing user's incoming mail file /var/mail/jru: done. Removing files belonging to jru from /tmp: done. Removing files belonging to jru from /var/tmp: done. Removing files belonging to jru from /var/tmp/vi.recover: done. # 8.6.3 chpasschpass shells chpass - - 8- 3 chpass #Changing user database information for jru. Login: jru Password: * Uid [#]: 1000 Gid [# or name]: 1000 Change [month day year]: Expire [month day year]: Class: Home directory: /home/jru Shell: /usr/local/bin/tcsh Full Name: J. Random User Office Location: Office Phone: Home Phone: Other information: 8 - 4 chpass #Changing user database information for jru. Shell: /usr/local/bin/tcsh Full Name: J. Random User Office Location: 129 Office Phone: Home Phone: Other information: chfn chsh ypchpass ypchfn ypchsh chpass NIS yp 17 NIS 8.6.4passwdpasswd : - - 8- 5 % passwd Changing local password for jru. Old password: New password: Retype new password: passwd: updating the database... passwd: done 8 - 6 # passwd jru Changing local password for jru. New password: Retype new password: passwd: updating the database... passwd: done chpass yppasswd passwd NIS 8.6.5pw pw - pw 8.7 FreeBSD 12.5 CPU memory 130

coredumpsize core - cputime CPU CPU top ps CPU filesize maxproc kern.maxproc makecc memorylocked amd memoryuse openfiles FreeBSD IPC kern.maxfiles sysctl sbsize stacksize 131

# pw groupadd teamtwo # pw groupshow teamtwo teamtwo:*:1100: 1100 teamtwo ID teamtwo 8 - 8 pw # pw groupmod teamtwo -M jru # pw groupshow teamtwo teamtwo:*:1100:jru 8- 8 -M pw id 8-9 8 - 9 id 132 % id jru uid=1001(jru) gid=1001(jru) groups=1001(jru) 1100(teamtwo) jru jru teamtwo pw /etc/group group133

99

91

monolithic( ) FreeBSD - PCMCIA KLD Unix- FreeBSD GENERIC

134

# cd /usr/src/sys/i386/conf # cp GENERIC MYKERNEL FreeBSD MYKERNEL root -- MYKERNEL - vi FreeBSD -ee SunosBSD DOS GENERIC - /usr/src/UPDATING /sur/src/UPDATING FreeBSD - FreeBSD 135

make world 2 1 1 config # /usr/sbin/config MYKERNEL 2 # cd ../../compile/MYKERNEL 3 # make depend # make 4 # make install 2 1 /usr/src # cd /usr/src 2 # make buildkernel KERNCONF= MYKERNEL 3 # make installkernel KERNCONF=MYKERNEL FreeBS D4.2 KERNEL= KERNCONF= 2001 2 2 4.2- STABLE KERNCONF= config make depend make make install /kernel /kernel.old /dev 9.4 (keyword) # GENERIC ( ) GENERIC LINT (option) GENERIC LINT 136

386 3 386

64 4

) FreeBSD 4.x GENERIC /usr/src/sys/i386/conf/GENERIC /usr/src/sys/ i386/conf/LINT # # GENERIC -- Generic kernel configuration file for FreeBSD/i386 # # For more information on this file, please read the handbook section on # Kernel Configuration Files: # #http://www.FreeBSD.org/handbook/kernelconfig-config.html # # The handbook is also available locally in /usr/share/doc/handbook # if you've installed the doc distribution, otherwise always see the # FreeBSD World Wide Web server (http://www.FreeBSD.ORG/) for the # latest information. # # An exhaustive list of options and more detailed explanations of the # device lines is also present in the ./LINT configuration file. If you are # in doubt as to the purpose or necessity of a line, check first in LINT. # # $FreeBSD: src/sys/i386/conf/GENERIC,v 1.246 2000/03/09 16:32:55 jlemon Exp $ machinei386 i386 alpha pc98 cpuI386_CPU cpu I486_CPU cpu I586_CPU cpuI686_CPU CPU CPU I586_CPU I686_CPU CPU CPU dmesg Alpha cpuEV4 cpuEV5 Alpha CPU 137 ident GENERIC GENERIC GENERIC ident maxusers32 system tables 4 XWindow - maxusers (process) 20+16* maxusers maxusers 1 36 18 ( ) X Window 15 man page maxusers=4 84 proc table full ( ftp.FreeBSD.org) maxusers (remote logins) pseudo- device pty 16 # Floating point support - do not disable. device npx0 at nexus? port IO_NPX irq 13 npx0 FreeBSD # Pseudo devices - the number indicates how many units to allocate. pseudo-deviceloop# Network loopback loop TCP/IP telnet ftp localhost( 127.0.0.1) #makeoptions DEBUG=-g#Build kernel with gdb(1) debug symbols options MATH_EMULATE#Support for x87 emulation (386 486SX) 486DX 386SX 486SX( 387 487 )Pentium Pentium II GPL_MATH_EMULATE GNU GNU optionsINET#InterNETworking optionsINET6#IPv6 communications protocols IPv6 - optionsFFS#Berkeley Fast Filesystem optionsFFS_ROOT#FFS usable as root device [keep this!] 138

optionsMFS#Memory Filesystem optionsMD_ROOT #MD is a potential root device Memory -mapped RAM disk swap /tmp MFS /tmp MFS RAM disk /etc/fstab /dev/ad1s2b/tmp mfs rw 0 0 mount/tmp optionsNFS #Network Filesystem optionsNFS_ROOT #NFS usable as root deviceNFS required (NFS) # optionsMSDOSFS#MSDOS Filesystem MS - DOS DOS DOS mtools ( ports ) DOS ( MSDOSFS ) optionsCD9660#ISO 9660 Filesystem optionsCD9660_ROOT#CD-ROM usable as rootCD9660 required CD -ROM ISO 9660 ( ) CD optionsPROCFS #Process filesystem Processfilesystem /proc ps optionsCOMPAT_43#Compatible with BSD 4.3 [KEEP THIS!] 4.3BSD optionsSCSI_DELAY=15000#Delay (in ms) before probing SCSI 15 SCSI SCSI IDE FreeBSD SCSI optionsUCONSOLE#Allow users to grab the console console X Window xterm -C xterm write talk kernel optionsUSERCONFIG#boot -c editor - optionsVISUAL_USERCONFIG #visual boot -c editor - 139 optionsKTRACE#ktrace(1) support optionsSYSVSHM #SYSV-style shared memory System V (SHM) SHM X Window XSHM ( XAnim Linux DOOM ) SHM X Window optionsSYSVSEM #SYSV-style semaphores System V semaphores kernel optionsSYSVMSG #SYSV-style message queues System V messages System V semaphores kernel ipcs System V options P1003_1B#Posix P1003_1B real-time extensions options _KPOSIX_PRIORITY_SCHEDULING 1993 POSIX ports collection Star Office optionsICMP_BANDLIM #Rate limit bad replies ICMP # To make an SMP kernelthe next two are needed #optionsSMP # Symmetric MultiProcessor Kernel #optionsAPIC_IO# Symmetric (APIC) I/O SMP deviceisa FreeBSD PC IBMPS/2( ) FreeBSD deviceeisa EISA EISA devicepci PCI PCI PCI ISA # Floppy drives devicefdc0at isa? port IO_FD1 irq 6 drq 2 devicefd0 at fdc0 drive 0 devicefd1 at fdc0 drive 1 fd0 A: fd1 B: ft0 QIC -80 deviceata ATA A TAPI ata 140 deviceatadisk # ATA disk drives ATAPI deviceatapicd # ATAPI CDROM drives ATAPI CDROM deviceatapifd # ATAPI floppy drives ATAPI deviceatapist # ATAPI tape drives ATAPI options ATA_STATIC_ID#Static device numbering # ATA and ATAPI devices deviceata0at isa? port IO_WD1 irq 14 deviceata1at isa? port IO_WD2 irq 15 PCI # SCSI Controllers deviceahb# EISA AHA1742 family deviceahc# AHA2940 and onboard AIC7xxx devices deviceamd# AMD 53C974 (Teckram DC-390(T)) devicedpt# DPT Smartcache - See LINT for options! deviceisp# Qlogic family devicencr# NCR/Symbios Logic devicesym# NCR/Symbios Logic (newer chipsets) deviceadv0 at isa? deviceadw devicebt0at isa? deviceaha0 at isa? deviceaic0 at isa? SCSI IDE # SCSI peripherals devicescbus # SCSI bus (required) deviceda # Direct Access (disks) devicesa # Sequential Access (tape etc) devicecd # CD devicepass # Passthrough device (direct SCSI access) SCSI -- # RAID controllers deviceida# Compaq Smart RAID deviceamr# AMI MegaRAID devicemlx# Mylex DAC960 family RAID # atkbdc0 controls both the keyboard and the PS/2 mouse deviceatkbdc0at isa? port IO_KBD atkbdc AT PS/2 I/O atkbd 141 2 deviceatkbd0 at atkbdc? irq 1 atkbd atkbdc AT AT84 AT devicepsm0 at atkbdc? irq 12 PS/2 devicevga0at isa? # splash screen/screen saver pseudo-devicesplash - # syscons is the default console driverresembling an SCO console device sc0 at isa? sc0 termcap terminaldatabase library VT220 vt0 sc0 TERM scoansi # Enable this and PCVT_FREEBSD for pcvt vt220 compatible console driver #device vt0at isa? #optionsXSERVER# support for X server on a vt console #optionsFAT_CURSOR# start with block cursor # If you have a ThinkPADuncomment this along with the rest of the PCVT lines #optionsPCVT_SCANSET=2 # IBM keyboards are non-std VT220 VT100/102 sc0 TERM vt100 vt220 termcap terminfo sc0 vt100 # Power management support (see LINT for more options) device apm0 at nexus? disable flags 0x20# Advanced Power Management # PCCARD (PCMCIA) support devicecard devicepcic0at isa? irq 10 port 0x3e0 iomem 0xd0000 devicepcic1at isa? irq 11 port 0x3e2 iomem 0xd4000 disable PCMCIA # Serial (COM) ports device sio0 at isa? port IO_COM1 flags 0x10 irq 4 device sio1 at isa? port IO_COM2 irq 3 device sio2 at isa? disable port IO_COM3 irq 5 device sio3 at isa? disable port IO_COM4 irq 9 4 MS -DOS/W indows COM1 COM4 sio0 sio3 MS - DOS COM1 COM4 COM4 IRQ 2(- IRQ 2 IRQ 9 ) ( S3 142 0281643 4 # Parallel port deviceppc0at isa? irq 7 ISA -bus deviceppbus # Parallel port bus (required) devicelpt # Printer deviceplip# TCP/IP over parallel deviceppi # Parallel port interface device I/O (geek port) + IEEE1284 I/O #device vpo # Requires scbus and da Iomega Zip scbus da EPP 1.9 # PCI Ethernet NICs. devicede# DEC/Intel DC21x4x ("Tulip") devicefxp # Intel EtherExpress PRO/100B (8255782558) devicetx# SMC 9432TX (83c170 "EPIC") devicevx# 3Com 3c5903c595 ("Vortex") devicewx# Intel Gigabit Ethernet Card ("Wiseman") PCI # PCI Ethernet NICs that use the common MII bus controller code. devicemiibus# MII bus support MII PCI 10/100 Ethernet NICs devicedc# DEC/Intel 21143 and various workalikes devicerl# RealTek 8129/8139 devicesf# Adaptec AIC-6915 ("Starfire") devicesis # Silicon Integrated Systems SiS 900/SiS 7016 deviceste # Sundance ST201 (D-Link DFE-550TX) devicetl# Texas Instruments ThunderLAN devicevr# VIA RhineRhine II devicewb# Winbond W89C840F devicexl# 3Com 3c90x ("Boomerang" "Cyclone") MII # ISA Ethernet NICs. deviceed0at isa? port 0x280 irq 10 iomem 0xd8000 deviceex deviceep # WaveLAN/IEEE 802.11 wireless NICs. Note: the WaveLAN/IEEE really # exists only as a PCMCIA deviceso there is no ISA attachment needed 143 # and resources will always be dynamically assigned by the pccard code. devicewi # Aironet 4500/4800 802.11 wireless NICs. Note: the declaration below will # work for PCMCIA and PCI cardsas well as ISA cards set to ISA PnP # mode (the factory default). If you set the switches on your ISA # card for a manually chosen I/O address and IRQyou must specify # those parameters here. devicean # The probe order of these is presently determined by i386/isa/isa_compat.c. deviceie0 at isa? port 0x300 irq 10 iomem 0xd0000 devicefe0 at isa? port 0x300 devicele0 at isa? port 0x300 irq 5 iomem 0xd0000 devicelnc0at isa? port 0x280 irq 10 drq 0 devicecs0 at isa? port 0x300 devicesn0 at isa? port 0x300 irq 10 # requires PCCARD (PCMCIA) support to be activated #device xe0 at isa? ISA /usr/src/sys/i386/conf/LINT pseudo-device ether # Ethernet support ether - pseudo-device sl1 # Kernel SLIP Sl SLIP - PPP - pseudo-device ppp 1 # Kernel PPP ppp (kernel-mode) PPP tun (user-mode) PPP tun PPP PPP sl PPP pseudo-device tun # Packet tunnel. tun PPP (dial-on-demand) tun PPP PPP 16.2 pseudo-device pty # Pseudo-ttys (telnet etc) pty loginport ctelnet rlogin xterm emacs pty number pty 16 256 pseudo-device md# Memory "disks" pseudo-device gif 4 # IPv6 and IPv4 tunneling IPv6 IPv4 IPv4 IPv6 IPv4 IPv4 IPv6 IPv6 - pseudo-device faith 1 # IPv6-to-IPv4 relaying (translation) IPv4/IPv6 - # The `bpf' pseudo-device enables the Berkeley Packet Filter. # Be aware of the administrative consequences of enabling this! pseudo-device bpf # Berkeley packet filter 144

# USB support #device uhci# UHCI PCI->USB interface #device ohci# OHCI PCI->USB interface #device usb # USB Bus (required) #device ugen# Generic #device uhid# "Human Interface Devices" #device ukbd# Keyboard #device ulpt# Printer #device umass # Disks/Mass storage - Requires scbus and da #device ums # Mouse # USB Ethernetrequires mii #device aue # ADMtek USB ethernet #device cue # CATC USB ethernet #device kue # Kawasaki LSI USB Ethernet USB FreeBSD /usr/src/sys/i386/conf/LINT9.5 /dev /dev/MAKEDEV IDE CD -ROM device acd0 /dev acd0 c r raw /dev # sh MAKEDEV acd0 /dev acd0c racd0c - # sh MAKEDEV snd0 /etc/fbtab fbtab GENERIC SCSI SLIP/PPP SLIP/PPP 145 96

config:line 17:syntax error vi 17G 17 GENERIC config FreeBSD BSD FreeBSD loader /var/log/messages dmesg GEN ERIC kernel.old kernel.old ps #chflagsnoschg /kernel - /etc/rc.conf kern_securelevel=-1 #chflagsschg /kernel ps 3.x 4.x ps vmstat libkvm 146

1100

101

- Unix schg 147

123 45

1 23 4 567 148 103 1031

5 * /etc/master.passwd/ foobar:R9DT/Fa1/LV9U:1000:1000::0:0:Foo Bar:/home/foobar:/usr/local/bin/tcsh foobar:*:1000:1000::0:0:Foo Bar:/home/foobar:/usr/local/bin/tcsh * / kerberos ssh kerberos kerberos ssh / ssh- keygen * 149

1032

1001998

1033* ssh kerberos crypted 150

1034

1035

1 1

1036

switch NFS hub NFS ssh NFS find md5 md5 suid ssh NFS scp scp 151 5

1037

1038

1 2 3

1

4000152 5000 4915265535 4000 ICMP ping - IP LAN ping ping LAN- - 120MB ICMP ICMP ICMP ICMP FreeBSD ICMP_BANDLIM inetd udpecho A echo B echo UDP chargen inetd - net.inet.ip.rtexpirertminexpire rtmaxcachesysctl IP - netstat - rna | fgrep W3 1600 rtexpire rtminexpire 1 2 rtminexpire T3 Internet sysctl rtexpire rtminexpire 0 2 10.3.9 Kerberos SSH kerberos ssh Kerberos V- telnet rlogin kerberos - x ssh kerberos ssh ssh kerberos ssh key- forwarding authorized_keys from=IP/DOMAIN 10.4DES MD5 CryptUnix one- way hash 153

55

515 64

55 5 5

% ls -l /usr/lib/libcrypt* lrwxr-xr-x1 rootwheel13 Mar 19 06:56 libcrypt.a -> libdescrypt.a lrwxr-xr-x1 rootwheel18 Mar 19 06:56 libcrypt.so.2.0 -> libdescrypt.so.2.0 lrwxr-xr-x1 rootwheel15 Mar 19 06:56 libcrypt_p.a -> libdescrypt_p.a MD5 libscrypt libdescrypt DES crypt libdescrypt /etc/login.conf passwd_format DES MD5 login.conf10.5 S/KeyS/key hash FreeBSD MD4 hash MD5 DES - MAC 1.1.5 S/key - FreeBSD S/key Bell Communications Research Inc Unix Kerberos Unix password S/key OPIE opiekey keyinit opiepasswd one- time password key/opiekey keyinit/opiepasswd secret password password Unix password S/key OPIE Unix 8 6 7 S/key OPIE Unix password S/key OPIE seedkey iterationcount 1 100 S/key 154 4 1

1051

% keyinit Adding unfurl: Reminder - Only use this method if you are directly connected. If you are using telnet or rlogin exit with no password and use keyinit -s. Enter secret password:Again secret password: ID unfurl s/key is 99 to17757 DEFY CLUB PRO NASH LACE SOFT OPIE opiepasswd % opiepasswd -c [grimreaper] ~ $ opiepasswd -f -c Adding unfurl: Only use this method from the console; NEVER from remote. If you are using telnet, xterm, or a dial-in, type ^C now or exit with no password. Then run opiepasswd without the -c parameter. Using MD5 to compute responses. Enter new secret pass phrase: Again new secret pass phrase: ID unfurl OTP key is 499 to4268 MOS MALL GOAT ARM AVID COED Enter new secret pass phrase Enter Secret password ID S/key S/key 10.5.2 S/key - Macintosh 155 100

% keyinit -s Updating unfurl: Old key: to17758 Reminder you need the 6 English words from the key command. Enter sequence count from 1 to 9999: 100 Enter new key [default to17759]:s/key 100 to 17759 s/key access pass word: s/key access password:CURE MIKE BANE HIM RACY GORE OPIE opiepasswd: % opiepasswd Updating unfurl: You need the response from an OTP generator. Old secret pass phrase: otp-md5 498 to4268 ext Response: GAME GAG WELT OUT DOWN CHAT New secret pass phrase: otp-md5 499 to4269 Response: LINE PAP MILK NELL BUOY TROY ID mark OTP key is 499 gr4269 LINE PAP MILK NELL BUOY TROY return S/key % key 100 to17759 Reminder - Do not use this program while logged in via telnet or rlogin. Enter secret password: CURE MIKE BANE HIM RACY GORE OPIE % opiekey 498 to4268 Using the MD5 algorithm to compute response. Reminder: Dont use opiekey from telnet or dial-in sessions. Enter secret pass phrase: GAME GAG WELT OUT DOWN CHAT 10.5.3 S/key % telnet example.com Trying 10.0.0.1... Connected to example.com Escape character is '^]'. FreeBSD/i386 (example.com) (ttypa) login: s/key 97 fw13894 Password: 156 % telnet example.com Trying 10.0.0.1... Connected to example.com Escape character is ^]. FreeBSD/i386 (example.com) (ttypa) login: otp-md5 498 gr4269 ext Password: S/key OPIE return S/key UNIX S/key s/key % key 97 fw13894 Reminder - Do not use this program while logged in via telnet or rlogin. Enter secret password:WELD LIP ACTS ENDS ME HAAG OPIE % opiekey 498 to4268 Using the MD5 algorithm to compute response. Reminder: Dont use opiekey from telnet or dial-in sessions. Enter secret pass phrase: GAME GAG WELT OUT DOWN CHAT - login: s/key 97 fw13894 Password: s/key 97 fw13894 Password [echo on]: WELD LIP ACTS ENDS ME HAAG Last login: Tue Mar 21 11:56:41 from 10.0.0.2 ... 10.5.4 key % key -n 5 30 zz99999 Reminder - Do not use this program while logged in via telnet or rlogin. Enter secret password: 26: SODA RUDE LEA LIND BUDD SILT27: JILT SPY DUTY GLOW COWL ROT 28: THEM OW COLA RUNT BONG SCOT 29: COT MASH BARR BRIM NAN FLAG 30: CAN KNEE CAST NAME FOLK BILK -n 5 5 30 157

1055

permit Internet 192.168.0.0 255.255.0.0 permit user fnord permit port ttyd0 IP Unix s/key Unix fnord Unix ,ttyd0 10.6 KerberosKerberos /- FreeBSD Kerberos 10.6.1 KerberosKerberos FreeBSD FreeBSD krb4 krb5 FreeBSD Kerberos 4.4BSD -Lite eBones USA/Canada MIT Kerberos ports collection /security/krb510.6.2 Kerberos Kerberos /etc/kerberosIV # cd /etc/kerberosIV # ls READMEkrb.confkrb.realms ( principal.* master_key) kdb_destroy Kerberos Kerberos - krb.conf krb.realms Kerberos GRONDAR.ZA grunt.grondar.za - krb.conf 158 # cat krb.conf EXAMPLE.COM EXAMPLE.COM grunt.example.com admin server CS.BERKELEY.EDU okeeffe.berkeley.edu ATHENA.MIT.EDU kerberos.mit.edu ATHENA.MIT.EDU kerberos-1.mit.edu ATHENA.MIT.EDU kerberos-2.mit.edu ATHENA.MIT.EDU kerberos-3.mit.edu LCS.MIT.EDU kerberos.lcs.mit.edu TELECOM.MIT.EDU bitsy.mit.edu ARC.NASA.GOV trident.arc.nasa.gov / keydistributioncenter adminserver Kerberos grunt.grondar.zaGRONDAR.ZA .grondar.zakrb.realms # cat krb.realms grunt.example.com EXAMPLE.COM .example.com EXAMPLE.COM .berkeley.edu CS.BERKELEY.EDU .MIT.EDU ATHENA.MIT.EDU .mit.edu ATHENA.MIT.EDU - Kerberos kdb_init # kdb_init Realm name [defaultATHENA.MIT.EDU ]: EXAMPLE.COM You will be prompted for the database Master Password. It is important that you NOT FORGET this password. Enter Kerberos master key: kstash # kstash Enter Kerberos master key: Current Kerberos master key version is 1. Master key entered. BEWARE! /etc/kerberosIV/master_key10.6.3 Kerberos kpasswd 159 # kdb_edit Opening database... Enter Kerberos master key: Current Kerberos master key version is 1. Master key entered.BEWARE! Previous or default values are in [brackets] enter return to leave the sameor new value. Principal name: passwd Instance: grunt Create [y] ? y Principal: passwdInstance: gruntkdc_key_ver: 1 New Password: /dev/lptN 0 # cat > /dev/lptN ENTER CONTROL+D # cat file > /dev/lptN file182

12 printer:dv=/dev/port:br#bps-rate:pa=parity port ttyd0 ttyd1 bps-rate parity even odd none zero 19200bps printer:dv=/dev/ttyd2:br#19200:pa=none 3 tip # tip printer - /etc/remote /dev/cuaa/dev/ttyd4 lptest% $lptest Postcript-PostcriptD

%>file file tip 4 :- /etc/printcap - LPD LPD /etc/printcap LPD spooling printcap - /etc/printcap /usr/share/misc/termcap /etc/remote cgetent 1 /etc/printcap 2 sh header pages Header Pages 3 sd Spooling 4 /etc/printcap lp /dev fs fc xs xc 183

56

630 4455 # #/etc/printcap for host rose # rattan|line|diablo|lp|Diablo 630 Line Printer: bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4: rattan line diablo lp Diablo 630 Line Printer lp bamboo ps PS S panasonic Panasonic KX -P4455 PostScript v51.4LPDspooling header page Header page - header pager /etc/printcap sh header pages /etc/printcap sh # #/etc/printcap for host rose - no header pages anywhere # rattan|line|diablo|lp|Diablo 630 Line Printer:\ :sh: bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ :sh: 184

# mkdir /var/spool/printer-name spooling PD rattan bamboo # mkdir /var/spool/lpd # mkdir /var/spool/lpd/rattan # mkdir /var/spool/lpd/bamboo spooling poolingdaemon

# chown daemon.daemon /var/spool/lpd/rattan # chown daemon.daemon /var/spool/lpd/bamboo # chmod 770 /var/spool/lpd/rattan # chmod 770 /var/spool/lpd/bamboo /etc/printcap sd spooling # #/etc/printcap for host rose - added spooling directories # rattan|line|diablo|lp|Diablo 630 Line Printer:\ :sh:sd=/var/spool/lpd/rattan: bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ :sh:sd=/var/spool/lpd/bamboo: TAB sd spooling spooling /var/spool/LPD /dev FreeBSD /dev LPD spooling /etc/printcap lp /dev rattan bamboo /etc/printcap # #/etc/printcap for host rose - identified what devices to use # rattan|line|diablo|lp|Diablo 630 Line Printer:\ :sh:sd=/var/spool/lpd/rattan:\ 185 :lp=/dev/lpt0: bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ :sh:sd=/var/spool/lpd/bamboo:\ :lp=/dev/ttyd5: /etc/printcap lp LPD /dev/lp /dev/lp FreeBSD LPD br#bps-rate bps-rate bps-rate 50 75 110 134 150 200 300600 1200 1800 2400 4800 9600 19200 38400 bit-per-secondfc#clear-bits sgttyb clear-bits fs#set-bits sgttyb set-bitsxc#clear-bits clear-bitsxs#set-bits set-bits fc fs xc xs bit /usr/include/sys/ioctl_compat.h LPD lp sgttyb fc fs local 38400 bps TANDEM ANYP LITOUT FLUSHO PASS8 local LITOUT PASS8 bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ :sh:sd=/var/spool/lpd/bamboo:\ :lp=/dev/ttyd5:fs#0x82000c1:xs#0x820: LPD LPD LPD lp /bin/cat shell FreeBSD lpf lpf lpf shell /usr/local/libexec/if -simple 186

#!/bin/sh # # if-simple - Simple text input filter for lpd # Installed in /usr/local/libexec/if-simple # # Simply copies stdin to stdout.Ignores all filter arguments. /bin/cat && exit 0 exit 2 # chmod 555 /usr/local/libexec/if-simple /etc/printcap if LPD /etc/printcap # #/etc/printcap for host rose - added text filter # rattan|line|diablo|lp|Diablo 630 Line Printer:\ :sh:sd=/var/spool/lpd/rattan:\ :lp=/dev/lpt0:\ :if=/usr/local/libexec/if-simple: bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ :sh:sd=/var/spool/lpd/bamboo:\ :lp=/dev/ttyd5:fs#0x82000e1:xs#0x820:\ :if=/usr/local/libexec/if-simple: LPDLPD /etc/rc LPD_enable NO /etc/rc.conf LPDlpd_enable="YES" to/etc/rc.conf,and then either restart your machine,or just run lpd(8). # lpd - LDP LPD lpr lpr lptest LPD # lptest 20 5 | lpr -Pprinter-name printer-name/etc/printcap lpr -PPostcript Postcriptlptestlpr file Postcript lptest

! "#$%&' *+ -./01234 "#$%&' *+ -./012345 #$%&' *+ -./0123456 $%&' *+ -./01234567 %&' *+ -./012345678 187 8060 6080

114

1141

188 1

filter-name [-c] -wwidth -llength -iindent -n login -h host acct-file -c lpr -l width /etc/printcap pw 132length pl 66indent lpr -i 0loginhostacct-file af

filter-name -xpixel-width -ypixel-height -n login -h host acct-file pixel-width px 0 pixel-height py 0

filter-name w width l length -w -l exit 0189 1

2

2

toner low psif textps lprps PostScript lprps Lprps FreeBSD Ports Collections colle ction lprps psif lprps port lprps /etc/printcap PostScript :if=/usr/local/libexec/psif: rw LPD PostScript lprps shell #!/bin/sh # #psif - Print PostScript or plain text on a PostScript printer #Script version; NOT the version that comes with lprps #Installed in /usr/local/libexec/psif # read first_line first_two_chars='expr "$first_line" : '\ ..\ '' if ["$first_two_chars"= "%!" ]; then # #PostScript jobprint it. # 190 echo "$first_line" && cat && printf "\004" && exit 0 exit 2 else # #Plain textconvert itthen print it. # echo "$first_line"; cat | /usr/local/bin/textps && printf "\004" && exit 0 exit 2 fi textps PostScript PostScript FreeBSDPortsCollectionscollection 4 a2ps PostScript 3 postscript postscriptPostScript PostScript FreeBSD Ghostscript PostScript AlladinEnterprises Ghostscript PostScript PostScript Ghostscript PostScript PostScript FreeBSD Ports Collections collection Ghostscript PostScript PostScript Ghostscript Hewlett Packard DeskJet 500 gs Ghostscript - sDEVICE gs -h Ghostscript #!/bin/sh # #ifhp - Print Ghostscript-simulated PostScript on a DeskJet 500 #Installed in /usr/local/libexec/hpif # #Treat LF as CR+LF: # printf "\033&k2G" || exit 2 # #Read first two characters of the file # read first_line first_two_chars='expr "$first_line" : '\ ..\ '' if["$first_two_chars" = "%!" ]; then # #It is PostScript; use Ghostscript to scan-convert and print it. # #note that PostScript files are actually interpreted programs #and those programs are allowed to write to stdoutwhich will #mess up the printed output.Sowe redirect stdout to stderr #and then make descriptor 3 go to stdoutand have Ghostscript #write its output there.Exercise for the clever reader: #capture the stderr output from Ghostscript and mail it back to #the user originating the print job. # exec 3>&1 1>&2 191 /usr/local/bin/gs -dSAFER -dNOPAUSE -q -sDEVICE=djet500 \ -sOutputFile=/dev/fd/3 - && exit 0 # /usr/local/bin/gs -dSAFER -dNOPAUSE -q -sDEVICE=djet500 -sOutputFile=- - \ && exit 0 else # #Plain text or HP/PCLso just print it directly; print a form feed #at the end to eject the last page. # echo $first_line && cat && printf "\033&l0H" &&exit 0 fi exit 2 if:if=/usr/local/libexec/hpif: lpr plain. text lpr whatever.ps 4 ASCII TeX PostScript TeX DVI PostScript % dvips seaweed-analysis.dvi % lpr seaweed-analysis.ps DV PDDV % lpr -d seaweed-analysis.dvi PD- dPDDV

/etc/printcap

DV DV trofftroff PD/etc/printcap lpr /etc/printcaplprcifplot cf-c DVdf-d plot gf-g ditroff nf-n A tetrf -f troff rf -f raster vf-v plain tet if none -p -l 192

# #/etc/printcap for host rose - added df filter for bamboo # rattan|line|diablo|lp|Diablo 630 Line Printer:\ :sh:sd=/var/spool/lpd/rattan:\ :lp=/dev/lpt0:\ :if=/usr/local/libexec/if-simple: bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ :sh:sd=/var/spool/lpd/bamboo:\ :lp=/dev/ttyd5:fs#0x82000e1:xs#0x820:rw:\ :if=/usr/local/libexec/psif:\ :df=/usr/local/libexec/psdf: DVI shell /usr/local/libexec/psdf #!/bin/sh # #psdf - DVI to PostScript printer filter #Installed in /usr/local/libexec/psdf # # Invoked by lpd when user runs lpr -d # exec /usr/local/bin/dvips -f | /usr/local/libexec/lprps "$@" dvips - f PostScrpt lprps LPD PostScript lprps raster GIF Hewlett Packard LaserJet III-Si #!/bin/sh # #hpvf - Convert GIF files into HP/PCLthen print 193 #Installed in /usr/local/libexec/hpvf PATH=/usr/X11R6/bin:$PATH; export PATH giftopnm | ppmtopgm | pgmtopbm | pbmtolj -resolution 300 \ && exit 0 \ || exit 2 GIF portableanymap portablegraymap portable bitmap LaserJet/PCL /etc/printcap # #/etc/printcap for host orchid # teak|hp|laserjet|Hewlett Packard LaserJet 3Si:\ :lp=/dev/lpt0:sh:sd=/var/spool/lpd/teak:mx#0:\ :if=/usr/local/libexec/hpif:\ :vf=/usr/local/libexec/hpvf: grpff troff PostScript bam boo #!/bin/sh # #pstf - Convert groff's troff data into PSthen print. #Installed in /usr/local/libexec/pstf # exec grops | /usr/local/libexec/lprps "$@" lprps #!/bin/sh # #pstf - Convert groff's troff data into PSthen print. #Installed in /usr/local/libexec/pstf # exec grops /etc/printcap:tf=/usr/local/libexec/pstf: FORTRAN FORTRAN teak #!/bin/sh # # hprf - FORTRAN text filter for LaserJet 3si: # Installed in /usr/local/libexec/hprf # printf "\033&k2G" && fpr && printf "\033&l0H" &&exit 0 exit 2 /etc/printcap teak :rf=/usr/local/libexec/hprf: teak DVI /etc/printcap DVI :df=/usr/local/libexec/hpdf: DVI PCL 194 222000 2 20 0 2

#!/bin/sh # #hpdf - Print DVI data on HP/PCL printer #Installed in /usr/local/libexec/hpdf PATH=/usr/local/bin:$PATH; export PATH # #Define a function to clean up our temporary files.These exist #in the current directorywhich will be the spooling directory #for the printer. # cleanup{ rm -f hpdf$$.dvi } # #Define a function to handle fatal errors: print the given message #and exit 2.Exiting with 2 tells LPD to do not try to reprint the #job. # fatal{ echo "$@" 1>&2 cleanup exit 2 } # #If user removes the jobLPD will send SIGINTso trap SIGINT # and a few other signalsto clean up after ourselves. # trap cleanup 1 2 15 # #Make sure we are not colliding with any existing files. # cleanup # #Link the DVI input file to standard inputthe file to print . # ln -s /dev/fd/0 hpdf$$.dvi || fatal "Cannot symlink /dev/fd/0" 195 # #Make LF = CR+LF # printf "\033&k2G" || fatal "Cannot initialize printer" ##Convert and print.Return value from dvilj2p does not seem to be #reliableso we ignore it. # dvilj2p -M1 -q -e- dfhp$$.dvi # #Clean up and exit # cleanup exit 0 lpr file FreeBSD Ports Collection apsfilter PostScript DVI 5 LPD spooling

filter-name w width l length width pw length pl LPD headerpages header page headerpage LPD LPD LPD header pages Header Pages LPD 2 ASCII 001 ASCII 031 196 031 001

6

1142

1 suppressheader headerpages sh Hewlett Packard PCL #!/bin/sh # #hpof - Output filter for Hewlett Packard PCL-compatible printers #Installed in /usr/local/libexec/hpof printf "\033&k2G" || exit 2 exec /usr/libexec/lpr/lpf of teak teak header pages 197 # #/etc/printcap for host orchid # teak|hp|laserjet|Hewlett Packard LaserJet 3Si:\ :lp=/dev/lpt0:sd=/var/spool/lpd/teak:mx#0:\ :if=/usr/local/libexec/hpif:\ :vf=/usr/local/libexec/hpvf:\ :of=/usr/local/libexec/hpof: teak header page lpr -h header pages Header Page lpr LPD header page /etc/printcap ff 2 header pages header pages LPD long header kelly rose outline k ll ll kll kll k k eeeellyy kk e ellyy k keeeeeellyy kk k ellyy k k eelly yy kk eeeellllllyyyy y yy yyyy ll tli tl oooo uutttttl iinnnneeee oouutlinn nee oouutlinneeeeee oouutlinne oouuu tt linnee oooo uuuuttllliii nn eeee rrrroooossss eeee rrr o oss e e r ooss eeeeee r ooss e r ooss e e roooossss eeee Job: outline Date: Sun Sep 17 11:04:58 1995 198

rose:kellyJob: outlineDate: Sun Sep 17 11:07:51 1995 LPD header page /etc/printcaphl header last 3 LPD headerpages headerpages header page header pages lpr - h header page headerpage lpr- h header page LPD - h lpr- h header page header page

header page header page headerpage lpr - h header pages PostScript header page #!/bin/sh # 199 #make-ps-header - make a PostScript header page on stdout #Installed in /usr/local/libexec/make-ps-header # # #These are PostScript units72 to the inch .Modify for A4 or #whatever size paper you are using: # page_width=612 page_height=792 border=72 # #Check arguments # if [ $# -ne 3 ]; then echo "Usage: 'basename $0' " 1>&2 exit 1 fi # #Save thesemostly for readability in the PostScriptbelow. # user=$1 host=$2 job=$3 date='date' # #Send the PostScript code to stdout. # exec cat &2 exit 2 ;; esac done ["$login" ] || fail "No login name" ["$host" ] || fail "No host name" /usr/local/libexec/make-ps-header $login $host "DVI File" /usr/local/bin/dvips -f | eval /usr/local/libexec/lprps $orig_args lpr suppressheadpage - h headerpages header page header pager Header Pages LPD header page PostScript 201

1143

1 LPDspooling LPD LPD LPD- LPD LPD LPD- Hewlett Packard Laserjet text LFCRLD hpif /etc/printcap 1 2 lp :lp=:3 spooling sd LPD 4 rm 5 rp /etc/printcap rose bamboo rattan orchid orchid /etc/printcap 202

# #/etc/printcap for host orchid - addedremoteprinters on rose # # #teak is local; it is connected directly to orchid: # teak|hp|laserjet|Hewlett Packard LaserJet 3Si:\ :lp=/dev/lpt0:sd=/var/spool/lpd/teak:mx#0:\ :if=/usr/local/libexec/ifhp:\ :vf=/usr/local/libexec/vfhp:\ :of=/usr/local/libexec/ofhp: # #rattan is connected to rose; send jobs for rattan to rose: # rattan|line|diablo|lp|Diablo 630 Line Printer:\ :lp=:rm=rose:rp=rattan:sd=/var/spool/lpd/rattan: # #bamboo is connected to rose as well: # bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ :lp=:rm=rose:rp=bamboo:sd=/var/spool/lpd/bamboo: orchid spooling # mkdir -p /var/spool/lpd/rattan /var/spool/lpd/bamboo # chmod 770 /var/spool/lpd/rattan /var/spool/lpd/bamboo # chown daemon.daemon /var/spool/lpd/rattan /var/spool/lpd/bamboo orchidrattan bamboo orchid % lpr -P bamboo -d sushi-review.dvi orchidPD/var/spool/PD/bamboo spooling DV rosebamboospooling PD roserose DVPostcriptbambooPostcriptrose 2

/etc/printcap P/P netprintnetprint

reeD203

#!/usr/bin/perl # #netprint - Text filter for printer attached to network #Installed in /usr/local/libexec/netprint # $#ARGV eq 1 || die "Usage: $0 "; $printer_host = $ARGV[0]; $printer_port = $ARGV[1]; require 'sys/socket.ph'; $ignore$ignore$protocol= getprotobyname 'tcp' ; $ignore$ignore$ignore$ignore$address= gethostbyname $printer_host ; $sockaddr = pack 'S n a4 x8'&AF_INET$printer_port$address ; socket PRINTER&PF_INET&SOCK_STREAM$protocol || die "Can't create TCP/IP stream socket: $!"; connect PRINTER$sockaddr|| die "Can't contact $printer_host: $!"; while{ print PRINTER; } exit 0; Diablo 750 -N 5100 scrivener #!/bin/sh # #diablo-if-net - Text filter for Diablo printer 'scrivener' listening #on port 5100. Installed in /usr/local/libexec/diablo-if-net # exec /usr/libexec/lpr/lpf "$@" | /usr/local/libexec/netprint scrivener 5100 11.4.4 LPD 1 LPD lpr - #5 5 /etc/printcap sc lpr -# -# lpr: multiple copies are not allowed /etc/printcap sc rose /etc/printcap rattan bamboo sc # #/etc/printcap for host rose - restrict multiple copies on bamboo # rattan|line|diablo|lp|Diablo 630 Line Printer:\ 204 :sh:sd=/var/spool/lpd/rattan:\ :lp=/dev/lpt0:\ :if=/usr/local/libexec/if-simple: bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ :sh:sd=/var/spool/lpd/bamboo:sc:\ :lp=/dev/ttyd5:fs#0x82000e1:xs#0x820:rw:\ :if=/usr/local/libexec/psif:\ :df=/usr/local/libexec/psdf: orchid /etc/printcap sc teak # #/etc/printcap for host orchid - no multiple copies for local #printer teak or remote printer bamboo teak|hp|laserjet|Hewlett Packard LaserJet 3Si:\ :lp=/dev/lpt0:sd=/var/spool/lpd/teak:mx#0:sc:\ :if=/usr/local/libexec/ifhp:\ :vf=/usr/local/libexec/vfhp:\ :of=/usr/local/libexec/ofhp: rattan|line|diablo|lp|Diablo 630 Line Printer:\ :lp=:rm=rose:rp=rattan:sd=/var/spool/lpd/rattan: bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ :lp=:rm=rose:rp=bamboo:sd=/var/spool/lpd/bamboo:sc: sc lpr -# lpr % lpr forsale.sign forsale.sign forsale.sign forsale.sign forsale.sign

2 /etc/printcap rg - rg rootlpr:Nota member of the restricted group sc rg rattan artists bamboo rose /etc/printcap # #/etc/printcap for host rose - restricted group for bamboo # rattan|line|diablo|lp|Diablo 630 Line Printer:\ :sh:sd=/var/spool/lpd/rattan:\ :lp=/dev/lpt0:\ :if=/usr/local/libexec/if-simple: bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ :sh:sd=/var/spool/lpd/bamboo:sc:rg=artists:\ :lp=/dev/ttyd5:fs#0x82000e1:xs#0x820:rw:\ :if=/usr/local/libexec/psif:\ :df=/usr/local/libexec/psdf: /etc/printcap orchid orchid bamboo orchid 205

3

1024 01000

5 # #/etc/printcap for host rose # # #No limit on job size: # rattan|line|diablo|lp|Diablo 630 Line Printer:\ :sh:mx#0:sd=/var/spool/lpd/rattan:\ :lp=/dev/lpt0:\ :if=/usr/local/libexec/if-simple: # #Limit of five megabytes: # bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ :sh:sd=/var/spool/lpd/bamboo:sc:rg=artists:mx#5000:\ :lp=/dev/ttyd5:fs#0x82000e1:xs#0x820:rw:\ :if=/usr/local/libexec/psif:\ :df=/usr/local/libexec/psdf: /etc/printcap mx 4 LPDspooling /etc/hosts.equiv /etc/hosts. lpd LPD LPD LPD /etc/hosts.equiv ruserok - rsh rcp rose /etc/hosts.LPDorchid violet madrigal.fishbaum.de 206

512

bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ :sh:sd=/var/spool/lpd/bamboo:sc:rg=artists:mx#5000:\ :lp=/dev/ttyd5:fs#0x82000e1:xs#0x820:rw:mx#5000:\ :if=/usr/local/libexec/psif:\ :df=/usr/local/libexec/psdf: Spooling sd 3MB 6144 # echo 6144 > /var/spool/lpd/bamboo/minfree

/etc/printcap rs rsPDPD

tokenhomeshell/usr/bin/false 11.4.5 LPDspooling

207 LPDspooling 1 FreeBSD lpf lpf pac LPD /etc/printcap af spooling LPD lpf pw pl lpf 2.00 rose:andy 3.00 rose:kelly 3.00 orchid:mary 5.00 orchid:mary 2.00 orchid:zhang lpf lpf /etc/printcap af=acct acct spooling pac spooling pac Login pages/feetruns price orchid:kelly 5.001$0.10 orchid:mary31.003$0.62 orchid:zhang9.001$0.18 rose:andy 2.001$0.04 rose:kelly 177.00104$3.54 rose:mary87.0032$1.74 rose:root 26.0012$0.52 total 337.00154$6.74 pac -Pprinter /etc/printcap af /etc/printcap -c -m alpha smith gamma smith 208 -pprice price /etc/printcap pc 2 price -r-s name ... pac pac -m Loginpages/feet runsprice andy2.00 1$0.04 kelly 182.00105$3.64 mary118.0035$2.36 root 26.0012$0.52 zhang9.001$0.18 total337.00154$6.74 pac /etc/printcap pc 2 pac -p -p # pac -p1.50 15 pac -ssum pac 2

lpflpf lpf

DVaseretDVPostcriptdvil dvips

-

Postcriptmagen

209 115

1151

% lpr filename ... lpr % lpr /etc/host.conf /etc/hosts.equiv % lpr -P printer-name filename ... rattan% ls -l | lpr -P rattan lpr lprls -l

lpr 11.5.2 lprPD spooling lpq - P % lpq -P bamboo bamboo lpq bamboo is ready and printing Rank OwnerJobFilesTotal Size active kelly9/etc/host.conf/etc/hosts.equiv 88 bytes 210 2ndkelly10standard input 1635 bytes 3rdmary 11 ... 78519 bytes bamboo kelly 9 9 lpr Rankactive lpr mary lpq lpq LPD lpq - l lpq - l waiting for bamboo to become readyoffline ?kelly: 1st[job 009rose] /etc/host.conf73 bytes /etc/hosts.equiv 15 bytes kelly: 2nd[job 010rose] standard input 1635 bytes mary: 3rd[job 011rose] /home/orchid/mary/research/venus/alpha-regio/mapping 78519 bytes 11.5.3 lprm lprm lpq % lprm job-number -P bamboo 10 % lprm -P bamboo 10 lprm lprm - lprm useruser lprm - lprm

-Prattan% lprm -P rattan - lprm

211 % lpr -P rattan myfile % rlogin orchid % lpq -P rattan Rank Owner JobFiles Total Size active seeyan12...49123 bytes 2ndkelly13 myfile 12 bytes % lprm -P rattan 13 rose: Permission denied % logout % lprm -P rattan 13 dfA013rose dequeued cfA013rose dequeued 11.5.4 lpr 1 lpr lpr bamboo DVI TeX fish-report.dvi% lpr -P bamboo -d fish-report.dvi DVditroff - p - - d DV

-c cifplot -d DVI -f FORTRAN -g plot -i number number number 8 - i -l- -n ditroff device independent troff -p pr pr -T title title pr header -p -t212 -v raster ls % zcat /usr/share/man/man1/ls.1.gz | troff -t -man | lpr -t zcat ls- troff troff lprPDlpr-ttroff 2 lpr PD# copies copies - parser.c parser.h% lpr -#3 parser.c parser.h -mPD - -s spoolings spooling spoolingPDspooling

PD - PD - s -r - spooling -s -

3 eader Page lpr header pages header pageseader Pagesheader pages - tet header pagetet - tet headertetstdin -h header page headerpages eader Pages 213 1155

abort printer-name clean printer-name spooling LPD spooling spooling disable printer-name root root enable down printer-name message disable stop m essage lpq lpc statusenable printer-name -help command-name command -name command -name restart printer-name LPD stop down restart abort startstart printer-name stop printer-name 214

topq printer-name job-or-username printer-name job username all printer-name up printer-name down start enable lpc lpc exit quit11.6 FreeBSD LPDspooling spooling FreeBSD LPRng LPRng LPR LPRng PLP Patrick Powell Justin MasonPLP LPRng LPRnghttp://www.astart.com/lprng/LPRng.html11.7 lptest PRINT REMAINING FORM FEED FORMFEED shell /usr/local/libexec/if- simple #!/bin/sh # # if-simple - Simple text input filter for lpd # Installed in /usr/local/libexec/if-simple # # Simply copies stdin to stdout.Ignores all filter arguments. # Writes a form feed character\fafter printing job. /bin/cat && printf "\f" && exit 0 exit 2 ! "#$%&' *+ -./01234 "#$%&' *+ -./012345 #$%&' *+ -./0123456 215

10 2 1013

#!/bin/sh # # hpif - Simple text input filter for lpd for HP-PCL based printers # Installed in /usr/local/libexec/hpif # # Simply copies stdin to stdout.Ignores all filter arguments. # Tells printer to treat LF as CR+LF.Ejects the page when done. printf "\033&k2G" && cat && printf "\033&l0H" && exit 0 exit 2 /etc/printcap orchid teak Hewlett-Packard LaserJet 3Si # #/etc/printcap for host orchid # teak|hp|laserjet|Hewlett Packard LaserJet 3Si:\ :lp=/dev/lpt0:sh:sd=/var/spool/lpd/teak:mx#0:\ :if=/usr/local/libexec/hpif: FreeBSD LF CR 216

rattan|line|diablo|lp|Diablo 630 Line Printer:\ :sh:sd=/var/spool/lpd/rattan:\ :lp=/dev/lpt0:\ :if=/usr/local/libexec/if-simple:\ :lf=/var/log/rattan.log /var/log/rattan.log lf LPD /dev/console 217

1122

121

218 123

1 1 401401

1111112311

1 21 remain cooperative with any future possible operating systems YES W q FDISK- None3 DiskLabel - - Disk label Editor BSD 8 a- h root / a b Sysinstall - e root swap - C FS swapFS /mnt post- install sysinstall /etc/fstab - W - sysinstall4 - /etc/fstab 219 1232 1

# dd if=/dev/zero of=/dev/rda1 bs=1k count=1 # fdisk -BI da1 ## disklabel -B -w -r da1s1 auto ## disklabel -e da1s1 #-# mkdir -p /1 # newfs /dev/da1s1e # # mount -t ufs /dev/da1s1e /1 # # vi /etc/fstab # /etc/fstab IDE ad da 4.x wd 2 microsoft # dd if=/dev/zero of=/dev/rda1 bs=1k count=1 # disklabel -Brw da1 auto # disklabel -e da1 #'e' # newfs -d0 /dev/rda1e # mkdir -p /1 # vi /etc/fstab # /dev/da1e # mount /1 # dd if=/dev/zero of=/dev/rda1 count=2 # disklabel /dev/rda1 | disklabel -BrR da1 /dev/stdin # newfs /dev/rda1e # mkdir -p /1 # vi /etc/fstab # add an entry for /dev/da1e # mount /1 12.4 CD FreeBSD coda md memorydisk vnconfig mdconfig 12.4.1 vnconfig : Vnconfig vnode vnode vnconfig 12- 1 vnconfig # vnconfig