UUCP: Network prior the Internet ================================ References: https://en.wikipedia.org/wiki/RS-232 https://www.codrey.com/embedded-systems/rs232-serial-communication/ http://wilsonminesco.com/RS-232/RS-232primer.html https://en.wikipedia.org/wiki/UUCP https://www.ibm.com/support/knowledgecenter/en/ssw_aix_71/com.ibm.aix.cmds5/uucp.htm UUCP is an abbreviation of Unix-to-Unix Copy. The term generally refers to a suite of computer programs and protocols allowing remote execution of commands and transfer of files, email and netnews between computers. A command named uucp is one of the programs in the suite; it provides a user interface for requesting file copy operations. The UUCP suite also includes uux (user interface for remote command execution), uucico (the communication program that performs the file transfers), uustat (reports statistics on recent activity), uuxqt (execute commands sent from remote machines), and uuname (reports the UUCP name of the local system). Some versions of the suite include uuencode/uudecode (convert 8-bit binary files to 7-bit text format and vice versa). Although UUCP was originally developed on Unix in the 1970s and 1980s, and is most closely associated with Unix-like systems, UUCP implementations exist for several non-Unix-like operating systems, including Microsoft's MS-DOS, IBM's OS/2, Digital's OpenVMS (for VAX hardware only), Commodore's AmigaOS, classic Mac OS, and even CP/M. UUCP can use several different types of physical connections and link layer protocols, but was most commonly used over dial-up connections. Before the widespread availability of Internet access, computers were only connected by smaller private networks within a company or organization. They were also often equipped with modems so they could be used remotely from character-mode terminals via dial-up telephone lines. UUCP used the computers' modems to dial out to other computers, establishing temporary, point-to-point links between them. Each system in a UUCP network has a list of neighbor systems, with phone numbers, login names and passwords, etc. When work (file transfer or command execution requests) is queued for a neighbor system, the uucico program typically calls that system to process the work. The uucico program can also poll its neighbors periodically to check for work queued on their side; this permits neighbors without dial-out capability to participate. UUCP was originally written at AT&T Bell Laboratories by Mike Lesk. By 1978 it was in use on 82 UNIX machines inside the Bell system, primarily for software distribution. It was released in 1979 as part of Version 7 Unix. The original UUCP was rewritten by AT&T researchers Peter Honeyman, David A. Nowitz, and Brian E. Redman around 1983. The rewrite is referred to as HDB or HoneyDanBer uucp, which was later enhanced, bug fixed, and repackaged as BNU UUCP ("Basic Network Utilities"). Each of these versions was distributed as proprietary software, which inspired Ian Lance Taylor to write a new free software version from scratch in 1991. Taylor UUCP was released under the GNU General Public License. Taylor UUCP addressed security holes which allowed some of the original network worms to remotely execute unexpected shell commands. Taylor UUCP also incorporated features of all previous versions of UUCP, allowing it to communicate with any other version and even use similar config file formats from other versions. UUCP was also implemented for non-UNIX operating systems, most-notably MS-DOS systems. Packages such as UUSLAVE/GNUUCP (John Gilmore, Garry Paxinos, Tim Pozar), UUPC (Drew Derbyshire) and FSUUCP (Christopher Ambler of IODesign), brought early Internet connectivity to personal computers, expanding the network beyond the interconnected university systems. FSUUCP formed the basis for many bulletin board system (BBS) packages such as Galacticomm's Major BBS and Mustang Software's Wildcat! BBS to connect to the UUCP network and exchange email and Usenet traffic. As an example, UFGATE (John Galvin, Garry Paxinos, Tim Pozar) was a package that provided a gateway between networks running Fidonet and UUCP protocols. FSUUCP was the only other implementation of Taylor's enhanced 'i' protocol, a significant improvement over the standard 'g' protocol used by most UUCP implementations. Simple configuration (direct serial link, no modems): On the Pi being called, enable serial login: Calling party is pi2b08, called party is pi2b07. pi@pi2b07:~ $ sudo /bin/bash root@pi2b07:/home/pi# adduser adduser: Only one or two names allowed. root@pi2b07:/home/pi# man adduser root@pi2b07:/home/pi# adduser uucico Adding user `uucico' ... Adding new group `uucico' (1001) ... Adding new user `uucico' (1001) with group `uucico' ... Creating home directory `/home/uucico' ... Copying files from `/etc/skel' ... Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully Changing the user information for uucico Enter the new value, or press ENTER for the default Full Name []: uucico Room Number []: Work Phone []: Home Phone []: Other []: Is the information correct? [Y/n] y root@pi2b07:/home/pi# root@pi2b07:/home/pi# which uucico /usr/sbin/uucico root@pi2b07:/home/pi# root@pi2b07:/home/pi# vipw Select an editor. To change later, run 'select-editor'. 1. /bin/ed 2. /bin/nano <---- easiest 3. /usr/bin/vim.tiny Choose 1-3 [2]: ... Change this: uucico:x:1001:1001:uucico,,,:/home/uucico:/bin/bash to this: uucico:x:1001:1001:uucico,,,:/home/uucico:/usr/sbin/uucico In /etc/group, change this: uucp:x:10: to this: uucp:x:10:uucico On pi2b08, add call destination, login and password to /etc/uucp/call: root@pi2b08:/etc/uucp# cat call # # call This file is used when the ``call-login'' or ``call-password'' # commands are used in the sys file with a "*" argument (e.g., # ``call-login *''). The system name is looked up in this file, # and the login name and password are used. # # The point of this is that the sys file may then be publically # readable, while still concealing the login names and passwords # used to connect to the remote system. # # The format is just system-name login-name password. # #alphen Utester grumblesmurf pi2b07 uucico uucico root@pi2b08:/etc/uucp# We'll be using a direct line (no modems) to connect to pi2b07, so we need to add the line's device and speed to /etc/uucp/port: root@pi2b08:/etc/uucp# tail -7 port # Direct line port DIRECT type direct device /dev/ttyUSB0 speed 9600 root@pi2b08:/etc/uucp# Finally, the called system needs to be known on the calling one. Add an entry to /etc/uucp/sys: # system pi2b05 # call-login uucico # call-password uucico # time any # address pi2b05 # port TCP # protocol t system pi2b07 call-login uucico call-password uucico time any chat "" \d\d\r\c ogin:-\r\c-ogin:-\r\c-ogin: \d\L word: \P port DIRECT root@pi2b08:/etc/uucp# The called host needs to know about the calling one, so add a matching entry to the called's sys (i.e. pi2b07): system pi2b08 call-login uucico call-password uucico time any chat "" \d\d\r\c ogin: \d\L word: \P port TCP protocol gvGt commands rnews rmail ls sync debug all local-receive ~ /home/pi/Spool remote-receive ~ /home/pi/Spool ----------------------------------------------------------------- Same setup, but using TCP/IP, not a serial connection: Caller needs to know hostname, port & protocol: system pi2b07 call-login uucico call-password uucico time any ## chat "" \d\d\r\c ogin:-\r\c-ogin:-\r\c-ogin:\r\c-ogin:-\r\c-ogin: \d\L word: \P address pi2b07 port TCP protocol t Called needs to have uucp-over-TCP enabled. Modify /etc/inetd.conf, changing this: #:MAIL: Mail, news and uucp services. ##uucp stream tcp nowait root /usr/sbin/tcpd /usr/sbin/in.uucpd to this: #:MAIL: Mail, news and uucp services. ##uucp stream tcp nowait root /usr/sbin/tcpd /usr/sbin/in.uucpd uucp stream tcp nowait root /usr/sbin/tcpd /usr/sbin/in.uucpd inetd needs to be made aware of this change, by sending it a SIGHUP: root@pi2b07:/etc# ps -ef | grep inetd root 290 1 0 09:13 ? 00:00:01 /usr/sbin/inetd root 1339 1334 0 13:11 pts/0 00:00:00 grep inetd root@pi2b07:/etc# kill -HUP 290 root@pi2b07:/etc# The receiving uucico does not use root permissions, therefore cannot access /etc/shadow to determine if the caller's credentials are valid, so uucp provides its own passwd file. Add the calling party's credentials to it: root@pi2b07:/etc/uucp# cat passwd # # passwd If you give access to your UUCP system over TCP to others, # and you run uucico directly from crontab, then uucico needs # to be able to read the password file to check the password # of the remote system. # # With a shadow system that's impossible - only root can read # the passwords from the shadow file. Therefore, if you're # in that situation, you can define the login passwords # here in plain text. # # Format: loginname password # #Utester grumblesmurf uucico uucico root@pi2b07:/etc/uucp# Documentation states that /etc/uucp/passwd must not be world-readable. Problem is that even with group read rights, and uucico in the uucp group, opening that file fails. Debug log shows this: uucico - - (2019-07-12 13:25:17.97 1483) DEBUG: flogin_prompt: Waiting for login uucico - - (2019-07-12 13:25:17.97 1483) DEBUG: fconn_write: Writing 7 "login: " uucico - - (2019-07-12 13:25:17.97 1483) DEBUG: zget_typed_line: Got "\r" uucico - - (2019-07-12 13:25:17.97 1483) DEBUG: fconn_write: Writing 7 "login: " uucico - - (2019-07-12 13:25:17.97 1483) DEBUG: zget_typed_line: Got "uucico\r" uucico - - (2019-07-12 13:25:18.02 1483) DEBUG: fconn_write: Writing 9 "Password:" uucico - - (2019-07-12 13:25:18.02 1483) DEBUG: zget_typed_line: Got "uucico\r" uucico - - (2019-07-12 13:25:18.07 1483) ERROR: /etc/uucp/passwd: fopen: Permission denied uucico - - (2019-07-12 13:25:18.07 1483) DEBUG: fconn_close: Closing connection uucico - - (2019-07-12 13:25:21.07 1484) DEBUG: usysdep_detach: Forked; old PID 1483, new pid 1484 Sounds like a bug. Granting world-read-rights to passwd works around that: root@pi2b07:/etc/uucp# chmod o+r passwd root@pi2b07:/etc/uucp# ls -ls passwd 4 -rw-r--r-- 1 root uucp 506 Jul 12 13:12 passwd root@pi2b07:/etc/uucp# pi@pi2b08:~ $ uucp uucpConfig.tgz 'pi2b07!/home/pi/Spool/uucpCfg3.tgz' pi@pi2b08:~ $ If transfer doesn't start because it ain't time to call again just yet, force a transfer: root@pi2b08:/var/log/uucp# /usr/sbin/uucico -r1 -f -x11 root@pi2b08:/var/log/uucp# Et voila: root@pi2b07:/etc/uucp# ls -ls ~pi/Spool total 12 4 -rw-rw-rw- 1 uucp dialout 3379 Jul 12 13:22 uucpCfg2.tgz 4 -rw-rw-rw- 1 uucp dialout 3379 Jul 12 13:29 uucpCfg3.tgz 4 -rw-rw-rw- 1 uucp dialout 3379 Jul 12 12:48 uucpCfg.tgz root@pi2b07:/etc/uucp#