Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

How can I configure my UNIX or/and Linux PC with COM port to support serial console connections? I would like to connect my notebook to that PC via a console cable and manage the PC with terminal emulation software like putty, as if I use keyboard directly.

share|improve this question
    
And FreeBSD ? Solaris ? –  TiFFolk Oct 29 '09 at 18:48
add comment

4 Answers 4

up vote 6 down vote accepted

I have this line in /etc/inittab on a server I run that has a serial console:

T0:23:respawn:/sbin/getty -L ttyS0 57600 vt100

ttyS0 is the serial port. That's all there is to it, at least here.

Edit: You'll probably want something like this in your grub.conf:

serial --unit=0 --speed=57600
terminal --timeout=10 serial console

And then with each kernel:

kernel /boot/vmlinuz ro root=/dev/md1 console=tty0 console=ttyS0,57600

(The important part is the console= arguments)

share|improve this answer
add comment

See the other answers if your distro uses inittab. But Ubuntu uses /etc/event.d and most other distros are or will as they adopt the more modern init daemon Upstart. At least it will eventually get rid of those hideous System V "run levels".

If you do have a /etc/event.d/, in there you should have tty1, tty2, .... You may need to copy one of the tty files to ttyS0. (Check /proc/devices to see what you have.)

These files look something like:

# tty1 - getty
#
# This service maintains a getty on tty1 from the point the system is
# started until it is shut down again.

start on stopped rc2
start on stopped rc3
start on stopped rc4
start on stopped rc5

stop on runlevel 0
stop on runlevel 1
stop on runlevel 6

respawn
exec /sbin/getty 38400 tty1

Be sure the device name and the speed are what you want.

share|improve this answer
    
Huh. New to me! –  Bill Weiss Oct 29 '09 at 19:06
add comment

In addition to the other answers, I'd suggest looking here:

http://tldp.org/HOWTO/Remote-Serial-Console-HOWTO/

Specifically, the GRUB section so that you can get the boot menu too (not just the OS once it begins to load):

http://tldp.org/HOWTO/Remote-Serial-Console-HOWTO/configure-kernel-grub.html

share|improve this answer
    
Yep, having this for the boot process as well as later stages is highly recommended, especially if you're going to rely on it as the main/sole means of access. –  Lee B Oct 29 '09 at 23:11
add comment

You just tell the machine you want to connect to with the serial console to listen on a serial port. Most Linux distributions come with examples in their /etc/inittab files that show how to do it (look for /dev/ttyS0).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.