Serial Console Links:
Serial Console Configuration
--------------------------------------------------------------------------------
Serial Ports:
openbsd:
/dev/tty01 - com1
/dev/tty02 - com2
usermod -G dialer username
cu -l /dev/tty01 -s 9600
exit: ~^D or ~.
debian:
/dev/ttyS0 - com1
/dev/ttyS1 - com2
Find serial ports:
# dmesg | grep tty
-or-
# apt-get install setserial
# setserial -g /dev/ttyS[01]
--------------------------------------------------------------------------------
A getty is is a program that opens a tty port, prompts for a login name, and
runs the /bin/login command. It is normally invoked by init.
The /etc/inittab file must be reconfigured to allow serial console logins. You
will note that the mingetty daemon is used to listen for virtual consoles (like
the 6 that run by default with your keyboard and monitor). You will need to
configure agetty or mgetty to listen on the serial ports, because they are
capable of responding to input on physical serial ports.
agetty:
handles console/dumb terminal connections as well as dial-in modem
connections.
mgetty:
...
debian:
agetty is already installed. named "getty" in debian.
apt-get install mgetty
backup /etc/inittab
# cp /etc/inittab /etc/inittab.orig
/etc/inittab (add):
# Run agetty on COM1/ttyS0 and COM2/ttyS1
s0:2345:respawn:/sbin/agetty -L -f /etc/issueserial 9600 ttyS0 vt100
s1:2345:respawn:/sbin/agetty -L -f /etc/issueserial 38400 ttyS1 vt100
# s1:2345:respawn:/sbin/agetty -L -i 38400 ttyS1 vt100
# Example how to put a getty on a serial line (for a terminal)
#
#T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100
#T1:23:respawn:/sbin/getty -L ttyS1 9600 vt100
# Example how to put a getty on a modem line.
#
#T3:23:respawn:/sbin/mgetty -x0 -s 57600 ttyS3
restart init
# init q
If you want to be able to login via serial console as the root user, you will
need to edit the /etc/securetty config file (add):
ttyS0
ttyS1
To change baud rate, change the settings in /etc/inittab, force a re-read of
/etc/inittab by init and restart the current daemons:
# edit /etc/inittab
# init q
# pkill agetty
--------------------------------------------------------------------------------
Configure serial port as THE system console
You can use options in /etc/grub.conf to redirect console output to one of your
serial ports. This can be handy if you do not have a keyboard or monitor
available for the Linux host in question. You can also see all of the bootup
and shutdown messages from your terminal. In this example, we will make the
/dev/ttyS1 port be the console. The text to add to the config file is present
on the second line:
# grub.conf
kernel /vmlinuz-2.4.20-24.9 ro root=LABEL=/
kernel /vmlinuz-2.4.20-24.9 ro root=LABEL=/ console=ttyS1,38400
Now, if you drop your system into single user mode with the "init 1" command,
you will still be able to administer the system from your serial-connected
terminal.
Note that the kudzu hardware detection program may "choke" on boot when the
serial port becomes the console, instead of the video adapter. To remedy this
situation, you should disable kudzu (assuming that your hardware is configured
properly and won't be changing). This is how you would do that (redhat):
# chkconfig kudzu off
# chkconfig --list kudzu
kudzu 0:off 1:off 2:off 3:off 4:off 5:off 6:off
You should also know how to break into the Grub bootloader during system
startup and edit the kernel line. By deleting the console argument from the
kernel line, you can boot the system with the standard console, which uses
the video card and attached keyboard. You have been warned!
--------------------------------------------------------------------------------
Null Modem Cable
To connect a laptop to the serial port on the Linux host, you need to have a
null-modem cable. The purpose of a null-modem cable is to permit two RS-232 DTE
devices to communicate with each other without modems between them.
http://yost.com/computers/RJ45-serial/
Null Modem Cable Pinout:
1 - 1
2 - 3
3 - 2
4 - 6
5 - 5
6 - 4
7 - 8
8 - 7
9 - 9
--------------------------------------------------------------------------------
minicom does not offer color as a terminal client, cu does.
To attach serial console to a Cisco Terminal Server's ASYNC-OCTAL RJ-45
plug, use a standard console db9 to rj45 adapter (not the modem adapter).