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