1*48637Sbostic.TL 2*48637SbosticSetting up the Net 3*48637Sbostic.AU 4*48637SbosticTom Truscott 5*48637Sbostic.AI 6*48637SbosticDuke University 7*48637Sbostic(now at the Research Triangle Institute, NC) 8*48637SbosticJanuary 1980 9*48637Sbostic(revised 1983 to better reflect reality) 10*48637Sbostic.SH 11*48637SbosticInstalling files and Programs. 12*48637Sbostic.PP 13*48637SbosticThis paper describes how to get the system named "xyz" on the uucp net. 14*48637SbosticIf you are on the net, stop reading! 15*48637SbosticIn chosing your system name, keep it short (no more than 7 characters long) 16*48637Sbosticand make it specific. 17*48637SbosticThat is, 'physics' is a poor uucp name! 18*48637SbosticThe University of California at Berkeley names their machines 19*48637Sbosticucbvax, ucbcad, ucbmone, etc. 20*48637SbosticA standard Seventh Edition 21*48637Sbostic.UX 22*48637Sbosticsystem is assumed. 23*48637Sbostic[Yup, this is ancient! I have deleted useless paragraphs -- trt] 24*48637SbosticThe v7 C compiler MUST be used to recompile uucp; 25*48637Sbosticthe Phototypesetter version fails. 26*48637SbosticIt is necessary to compile and install the mail, uucp, and news programs. 27*48637SbosticIn what follows, "/bin/..." can be replaced by "/usr/bin/...". 28*48637Sbostic.SH 29*48637SbosticMAIL 30*48637Sbostic.PP 31*48637SbosticIgnore this section if you machine already has a network 32*48637Sbosticmail program in place. 33*48637SbosticFirst, you must tell your machine its name. 34*48637SbosticModern versions of UNIX use gethostname(II) or uname(II). 35*48637SbosticAncient versions use include files. 36*48637SbosticIf you are in the dark ages, edit /usr/include/whoami.h 37*48637Sbosticand change the system name to xyz. 38*48637SbosticDo the same to /usr/include/ident.h 39*48637Sbostic(not currently used, by the way). 40*48637SbosticThen recompile mail: 41*48637Sbostic.DS 42*48637Sbosticcd /usr/src/cmd 43*48637Sbosticcmake mail 44*48637Sbostic.DE 45*48637Sbosticand copy it to /bin. 46*48637SbosticIt should be setuid to root. 47*48637SbosticThe network uses a restricted version of mail, 48*48637Sbosticwhich is actually mail but invoked with a different name: 49*48637Sbostic.DS 50*48637Sbosticln /bin/mail /bin/rmail 51*48637Sbostic.DE 52*48637SbosticMail should now be ready for the net. 53*48637SbosticA newer version of mail, called Mail, should be used if you have it. 54*48637SbosticIt invokes a mail delivery program called delivermail 55*48637Sbosticor the newer one called sendmail. 56*48637Sbostic.SH 57*48637SbosticUUCP 58*48637Sbostic.PP 59*48637SbosticRead the documents on uucp and uucp implementation in the 60*48637Sbostic.I 61*48637Sbostic.UX 62*48637SbosticProgrammer's Manual. 63*48637Sbostic.R 64*48637SbosticAlso read the manual pages for uucp and uux. 65*48637Sbostic.NH 1 66*48637SbosticGetting ready to install uucp 67*48637Sbostic.PP 68*48637SbosticEdit /etc/passwd to add the user "uucp" to your system. 69*48637SbosticUucp should have unique user and group ids (for security). 70*48637SbosticDuke's uucp and daemon have the same group id, 71*48637Sbosticso they can both access /dev/dn? 72*48637Sbosticwhich is not accessible by "others." 73*48637SbosticUucp will own the directories and other files of the uucp system. 74*48637SbosticActually, it is nice to also add the user "UUCP" as a synonym for "uucp", 75*48637Sbosticand put "UUCP" earlier in /etc/passwd. 76*48637SbosticThat way uucp will identified as UUCP in mail messages, etc., 77*48637Sbosticwhich highlights the fact that the messages are machine generated. 78*48637SbosticHere are typical lines: 79*48637Sbostic.DS L 80*48637SbosticUUCP:iPkI/ZUX3YX2Y:4:19::/usr/spool/uucppublic:/usr/lib/uucp/uucico 81*48637Sbosticuucp:iPkI/ZUX3YX2Y:4:19::/usr/spool/uucppublic:/usr/lib/uucp/uucico 82*48637Sbostic.DE 83*48637Sbostic.NH 1 84*48637SbosticInstalling uucp programs 85*48637Sbostic.PP 86*48637SbosticTo install uucp, read the INSTALL file in the uucp directory 87*48637Sbosticand follow the instructions. 88*48637SbosticIt references other documentation, which should also be read. 89*48637Sbostic.NH 1 90*48637SbosticFiles in /usr/lib/uucp 91*48637Sbostic.PP 92*48637SbosticAll of these files should have the uid and gid of uucp, 93*48637Sbosticand should not be readable (or writable) by others. 94*48637SbosticThe files "L-devices" and "L-dialcodes" 95*48637Sbosticare needed only if xyz calls other systems. 96*48637SbosticThe file formats are described in the documentation 97*48637Sbosticand are straightforward. 98*48637SbosticThe USERFILE file should have one line for each system which calls xyz: 99*48637Sbostic.DS 100*48637SbosticUduke,duke /usr/spool/uucppublic 101*48637Sbostic,xyz / 102*48637Sbostic.DE 103*48637SbosticThe first line of the sample USERFILE indicates 104*48637Sbosticthat the duke system uses login name Uduke 105*48637Sbosticand can access the public directory. 106*48637SbosticHere is a typical "Uduke" line in /etc/passwd: 107*48637Sbostic.DS L 108*48637SbosticUduke:PSB8EZ5w2tQ4I:4:19::/usr/spool/uucppublic:/usr/lib/uucp/uucico 109*48637Sbostic.DE 110*48637SbosticThis line differs from that for uucp 111*48637Sbosticonly in having a different login name and password. 112*48637SbosticThe last line of USERFILE should be ",xyz /", 113*48637Sbosticwhich permits local users but not remote systems 114*48637Sbosticto access anything on xyz. 115*48637Sbostic[Actually, USERFILE is a real botch. If you want security, 116*48637Sbosticnever given anyone permission from '/'.] 117*48637Sbostic.PP 118*48637SbosticThe file L.sys has a line for each system 119*48637Sbosticwith which xyz communicates. 120*48637SbosticIf xyz DOES NOT place calls to Duke 121*48637Sbosticthen the L.sys line for Duke might be: 122*48637Sbostic.DS 123*48637Sbosticduke None ACU 300 123-4567 ogin Uxyz ssword fooha 124*48637Sbostic.DE 125*48637SbosticThis line indicates that xyz should never ("None") call Duke. 126*48637SbosticIf xyz DOES place calls to Duke 127*48637Sbosticthen the line must be altered to so indicate. 128*48637SbosticThe documentation explains that case fairly well. 129*48637Sbostic.NH 1 130*48637SbosticGetting it running 131*48637Sbostic.PP 132*48637SbosticUucp is now ready for execution. 133*48637SbosticIf Duke is to call xyz, 134*48637Sbosticthe xyz system can request that Duke send mail 135*48637Sbosticto test its operation. 136*48637Sbostic/usr/spool/uucp/LOGFILE, SYSLOG, and ERRLOG 137*48637Sbosticare useful logs of uucp activity. 138*48637SbosticIf uucp does not work, and the problems cannot be resolved, 139*48637Sbosticxyz could give Duke another login on xyz 140*48637Sbosticso someone here can poke around 141*48637Sbosticand see what the problem might be. 142*48637SbosticThe login should have the same uid and gid as uucp 143*48637Sbosticbut without a uucico "shell". 144*48637Sbostic.PP 145*48637SbosticIf xyz can place calls to another system, 146*48637Sbostica good test is to try to place the call. 147*48637SbosticSuppose xyz has both a call-out and a call-in line. 148*48637SbosticThen an entry for the mythical system "foo" 149*48637Sbosticcan be put in the L.sys and USERFILE files, 150*48637Sbosticand xyz can call itself as follows: 151*48637Sbostic.DS 152*48637Sbosticecho "test 1" | mail foo!root 153*48637Sbosticecho "test 2" | mail foo!xyz!root 154*48637Sbosticecho "test 3" | mail foo!foo!root 155*48637Sbostic.DE 156*48637SbosticMail sent from system xyz to itself 157*48637Sbosticcauses a local invocation of mail. 158*48637SbosticMail sent to the mythical system "foo" will, 159*48637Sbostichowever, place a call to send the mail. 160*48637SbosticUucp will complain about locking, 161*48637Sbosticand shell metacharacters may not work, 162*48637Sbosticbut the communication should still succeed. 163*48637SbosticEven if xyz has only a call-in or call-out unit 164*48637Sbosticit may be possible to fake the other one 165*48637Sbosticby putting a null modem between the two lines. 166*48637Sbostic[Unfortunately, the newest version of uucp 167*48637Sbosticbotches loop testing fairly badly. 168*48637SbosticBut you can observe it successful connect.] 169*48637Sbostic.PP 170*48637SbosticAlso helpful is use of the "-x" debugging option. 171*48637SbosticThe debugging information produced by 172*48637Sbosticthis blatant security hole 173*48637Sbosticis truly a wonder to behold. 174*48637SbosticWhen it is in effect, the /usr/spool/uucp/AUDIT 175*48637Sbosticfile at the remote end will also collect debugging information. 176*48637Sbostic.NH 1 177*48637SbosticCleaning up after uucp 178*48637Sbostic.PP 179*48637SbosticUucp will run okay without any cleanup; 180*48637Sbostichowever, the uucp files can become immense. 181*48637SbosticDuke runs several shell files via cron(8). 182*48637SbosticThese are in uuaids/uu.*. 183*48637SbosticSystems which call Duke should run the following script occasionally: 184*48637Sbostic.DS 185*48637Sbostic/usr/lib/uucp/uucico -r1 -sduke 186*48637Sbostic.DE 187*48637SbosticSystems which call-out can 188*48637Sbosticrequest uucp to transmit waiting files: 189*48637Sbostic.DS 190*48637Sbostic/usr/lib/uucp/uucico -r1 191*48637Sbostic.DE 192*48637SbosticThe standard version of cron runs with uid "daemon" 193*48637Sbosticwhich may not be able to run the cleanup or uucico scripts. 194*48637SbosticThe scripts could be run via at(1), 195*48637Sbosticor you could remove the "setuid(1);" at the start of cron. 196*48637SbosticThen cron gives superuser privileges to its children. 197*48637SbosticAs a precaution, we run a program 198*48637Sbosticwhich does a setuid to uucp before invoking the scripts. 199*48637Sbostic.NH 1 200*48637SbosticObscure problems that can happen 201*48637Sbostic.PP 202*48637SbosticWhen uucp logs in, it is greeted (in standard V7 systems) 203*48637Sbosticwith the message of the day, "you have mail.", and so forth. 204*48637SbosticSometimes these messages cause uucp to fail. 205*48637SbosticOne cure is for login to suppress the messages 206*48637Sbosticwhen the user has a non-standard shell (e.g. uucico). 207*48637Sbostic.PP 208*48637SbosticIf you have implemented your own tty handler, 209*48637Sbosticbe sure it supports 8 bit RAW input and output. 210*48637SbosticYou should compare your own handler 211*48637Sbosticwith that of the standard tty.c, 212*48637Sbosticand make sure the RAW mode execution is the same. 213*48637Sbostic[This version does not yet support 7 bit datapath.] 214*48637Sbostic.SH 215*48637SbosticUSING THE NET 216*48637Sbostic.PP 217*48637SbosticThe simplest and least error-prone use of the net 218*48637Sbosticis that of sending mail from one system to another. 219*48637SbosticA user on xyz can send a letter to Duke as follows: 220*48637Sbostic.DS 221*48637Sbosticecho "xyz lives" | mail duke!root 222*48637Sbostic.DE 223*48637SbosticA letter can be sent to unc as follows: 224*48637Sbostic.DS 225*48637Sbosticecho "xyz lives on" | mail duke!unc!root 226*48637Sbostic.DE 227*48637SbosticHere are some local network enthusiasts: 228*48637Sbostic[I only kept this around for historical interest.] 229*48637Sbostic.TS 230*48637Sbosticl l l. 231*48637Sbosticduke!swd Steve Daniel C version of news 232*48637Sbosticduke!jte duke system administrator 233*48637Sbosticduke!trt Tom Truscott network enthusiast 234*48637Sbosticduke!unc!smb Steve Bellovin network news architecture 235*48637Sbosticduke!phs!dennis Dennis Rockwell V6/PWB UNIX enthusiast 236*48637Sbostic.TE 237*48637Sbostic.PP 238*48637SbosticUucp provides a convenient way 239*48637Sbosticto transfer files between systems. 240*48637SbosticFiles may be transferred by mailing them, 241*48637Sbosticbut that can get annoying. 242*48637SbosticHere are some hints for using uucp. 243*48637Sbostic.IP 1. 244*48637SbosticBy convention, the name "~uucp" may be used to access 245*48637Sbosticthe public directory on any system. 246*48637SbosticThus, 247*48637Sbostic.ti +5 248*48637Sbosticuucp -m -d x.c duke!~uucp/xyz/ 249*48637Sbostic.br 250*48637Sbosticcopies the file x.c to the subdirectory xyz 251*48637Sbosticof Duke's public directory (/usr/spool/uucppublic). 252*48637SbosticThe "-m" option requests that mail be sent when x.c is transmitted. 253*48637SbosticThe "-d" option requests that the remote system 254*48637Sbosticcreate any directories that are needed 255*48637Sbostic(in this case, the subdirectory xyz). 256*48637SbosticThe final "/" in ".../xyz/" 257*48637Sbosticinforms uucp that xyz is a directory and not an ordinary file. 258*48637Sbostic.IP 2. 259*48637Sbosticuucp -d -m x.c duke!unc!~uucp/xyz/ 260*48637Sbostic.br 261*48637Sbosticwill not work since uucp cannot handle "duke!unc!". 262*48637SbosticUucp and uux work only between two systems; 263*48637Sbosticthey do not handle a system-pathname sequence as does mail. 264*48637Sbostic[See uusend for a uucp-like multi-hop copy program.] 265*48637Sbostic.SH 266*48637SbosticNEWS 267*48637Sbostic.PP 268*48637SbosticYou are not running the distributed bulletin board?! 269*48637SbosticPoor innocent. Don't start. You can never go back. 270