Recent Changes - Search:


Code:


Social:


My journals will take the place of a blog. If you go to the Journal page there is an RSS feed to subscribe with.

« September 2017 
SunMonTueWedThuFriSat
     12
3456789
10111213141516
17181920212223
24252627282930

Sites I take responsibility for

West Volusia, Florida

Documents

Technical

General

Me

Living

Places I frequent

Hobbies

Humor

Items for sale:


Clipboard

edit SideBar

Using serial ports under Linux

Include our styles below Infobox - invoke as >>infobox<< ... >><<

Codebox: - invoke as >>codebox<< ... >><<

warnbox: - invoke as >>codebox<< ... >><<

editingbox: - invoke as >>codebox<< ... >><<

noticebox: - invoke as >>codebox<< ... >><<

Page bread crumbs: Welcome to ke3vin.org! - My Public Technical Notes - Hardware - Computer - Serial Port Hacking - using Serial Ports Under Linux

Pages by tags: (:listtags:)
Subscribe to this wiki: RSS Feed RSS or subscribe to this page for changes: RSS Feed RSS
496 articles have been published so far. Recent changes
Share

2016-03-22: This site is being moved to my main site at https://kevininscoe.com/wiki as part of a consolidation to one domain.


These notes have been transferred from my much older site http://old.ke3vin.org/geek/serial/linux/

I wrote this article back in 2000 but the information is still relevant and I have updated some of the dead links.

You can also use Putty for Linux and the screen command to access serial ports as well.


UUCP, cu and tip:

I often connect the servers I manage to terminal concentrators and often these concentrators are managed by a host system usually Sun and lately on Linux. On those host systems I typically use <a href="http://en.wikipedia.org/wiki/Tip_%28Unix_utility%29">tip</a> or <a href="http://www.columbia.edu/kermit/ckermit.html">C-Kermit</a>. But on Solaris I much prefer tip since it is simple and easy to maintain by setting up the <a href="http://www-kryo.desy.de/group/kakucs/docs/unix/tip_remote.html">"/etc/remote"</a> file.

In fact my latest problem was finding a copy of tip for Linux Redhat. I was not able to find a quick solution to that problem. I did find the <a href="http://cvsweb.netbsd.org/bsdweb.cgi/basesrc/usr.bin/tip/">source tree</a> for tip in the <a href="http://www.netbsd.org">Netbsd</a> collection. However after starting to compile it I found errors right away since it was based on the BSD collection.

First lets start with a little history for tip and the package of utilities which is found in the Unix to Unix Copy Program tool-set better known as <a href="http://www.oreilly.com/catalog/umuucp/">UUCP</a>.

UUCP was created around <a href="http://en.wikipedia.org/wiki/UUCP#History">1976</a> by Mike Lesk at AT&T Bell Laboratories in order to allow a simple yet configurable modem communications network between unix hosts.

Elaborate <a href="http://www.uucp.org/">maps</a> were created and eventually commercial services like <a href="http://en.wikipedia.org/wiki/UUNET">UUNet</a> provided UUCP connections for fifty cents a minute. This of course was all in the days before high-speed bandwidth was available or commercially viable.

<i>"Unix-to-Unix Copy Program," said PDP-1. "You will never find a more wretched hive of bugs and flamers. We must be cautious."</i> --<a href="http://www.bsd.org/decwars.html">DECWars</a>

There are two different UUCP packages out there: <a href="ftp://ftp.gnu.org/pub/gnu/uucp/">Taylor</a> named after it's creator, <a href="http://www.airs.com/ian/">Ian Taylor</a> which is derived from the BSD variants of unix and is the adopted GNU version.

The original UUCP by Mike Lesk was rewritten by AT&T researchers Peter Honeyman, David A. Nowitz, and Brian E. Redman. The AT&T rewrite is referred to as HDB or HoneyDanBer uucp, which was later enhanced, bug fixed, and repackaged as BNU UUCP ("Basic Network Utilities"). This HDB is the package you find on commercial unix derived from AT&T System V such as Solaris 2-11 and SGI Irix, HP HP-UX and IBM AIX version 4 and below.

Each of the AT&T versions were 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. In particular, Taylor UUCP addressed security holes which allowed some of the original internet worms to remotely execute unexpected shell commands. Taylor UUCP also incorporates features of all previous versions of UUCP, allowing it to communicate with any other version with the greatest level of compatibility and even use similar config file formats from other versions.

I point this out because they way UUCP tools such as the tip and cu commands behave are different or are completely removed between Solaris and Linux hosts. The configurations are different as well.

Now tip is included in the BNU distribution but was dropped by the time Taylor was developed. The <a href="http://www.cirr.com/support/uucp/taylor-docs/uucp_20.html#SEC20">cu</a> command is a replacement for tip and contains basically the same tilde (~) escape commands that tip does.

However Taylor UUCP is configured differently then HDB (although it is reported to support HDB file configuration - it didn't recognize /etc/remote for me). Instead of configuring /etc/remote I had to setup the file /etc/uucp/port.


Configuration and usage:

Here is my sample configuration:

 
# This is an example of a port file. This file have the syntax compatible
# with Taylor UUCP (not HDB, not anything else). Please check uucp
# documentation if you are not sure how Taylor config files are supposed to 
# look like. Edit it as appropriate for your system.

# Everything after a '#' character is a comment.

# (ttyS0 means COM1)

port serial
type direct
device /dev/ttyS0
speed 9600

An example session:

 $ cu -p serial
 Connected.
 ~.
 Disconnected.

If you see this error:

 cu: Access to port denied

Use chmod to change the permissions on /dev/ttyS0 as root:

 # chmod 666 /dev/ttyS0

Installing cu:

In CentOS/Redhat(RHEL) 6 and Fedora 20-22

Fedora - Install the EPEL - https://fedoraproject.org/wiki/EPEL

CentOS 6 - Install the EPEL repo - http://pkgs.org/centos-6/epel-x86_64/uucp-1.07-25.el6.x86_64.rpm.html

# yum install uucp

See note http://www.kodkast.com/linux-package-installation-steps?pkg=uucp for RHEL/CentOS 5.


Books that cover UUCP:

Managing UUCP and Usenet, 10th Edition

Practical UNIX and Internet Security, 3rd Edition - Chapter 15

Linux Network Administrator's Guide, 2nd Edition (free online)

Using UUCP and Usenet

Inside Linux - Chapter 14


UUCP Notes:

Ian Taylor UUCP documentation

Ian Taylor UUCP site

GNU site for Taylor UUCP Ian Taylor's site is more up to date I think

Frequently Asked Questions about Linux UUCP

Book - Linux Network Administrator's Guide, 2nd Edition (free online)

The Linux UUCP HOWTO

The Linux Serial HOWTO

Taylor UUCP configuration

Taylor UUCP mailing list


Minicom:

Other software that can work with serial ports on Linux is <a href="http://alioth.debian.org/projects/minicom/">minicom</a>.

Be sure to use the minicom -o option to avoid the modem initialization being sent to the server on the serial port!


setserial command:

Notes:

http://www.commandlinefu.com/commands/view/10218/ttys0-terminal-on-serial-connection

 $ sudo setserial -q /dev/ttyS0
 /dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4

Serial port capture and hacking:

http://ubuntuforums.org/showthread.php?t=13667

http://linuxgazette.net/issue48/tag/52.html

http://www.google.com/search?q=linux+intercept+serial+port&btnG=Google+Search


Kevin's Public Wiki maintained and created by Kevin P. Inscoe is licensed under a
Creative Commons Attribution 3.0 United States License.

Back to my web site - http://kevininscoe.com

Edit - History - Print - Recent Changes - Search
Page last modified on July 30, 2015, at 07:37 PM EST