Difference between revisions of "Serial Login"

From YobiWiki
Jump to navigation Jump to search
Line 35: Line 35:
 
You can use
 
You can use
 
* minicom
 
* minicom
  +
* socat (man pages of stty and termios can help understanding the tweaks of terminals
* socat
 
 
socat -,icanon=0,echo=0 /dev/ttyUSB2,raw,echo=0,b9600
 
socat -,icanon=0,echo=0 /dev/ttyUSB2,raw,echo=0,b9600
 
With that socat command:
 
With that socat command:

Revision as of 20:49, 20 February 2007

Inspired by http://www.rajeevnet.com/linux/grub_serial_console.html but the Debian way.

Support in BIOS

I use 57600 as this is the speed set in my BIOS (yes, even BIOS management via serial!)

Support in Grub

Add to /boot/grub/menu.lst

# Setup serial (COM1) here with baudrate 57600
# use --unit=1 (for COM2) and so on
serial --unit=0 --speed=57600
#
# Now setup terminal as both Serial Line(/dev/ttyS0) and
# Monitor Console(/dev/tty0) depending upon where you press key
# with in timeout (15 sec) period. Otherwise first entry
# (console(Monitor)=>tty0) is selected here.
terminal --timeout=15  console serial

Then

update-grub

Support in Kernel

To get messages on both consoles, use "console=ttyS0,57600" and "console=tty0", modify these lines (but let them commented!) in /boot/grub/menu.lst to change kernel options

# defoptions=console=ttyS0,57600 console=tty0
# altoptions=(recovery mode) console=ttyS0,57600 console=tty0 single
# altoptions=(recovery mode via serial) console=tty0 console=ttyS0,57600 single

Then

update-grub

Support in console

Uncomment in /etc/inittab and change speed

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

check if ttyS0 is well present in /etc/securetty to be able to login directly as root

Usage

You can use

  • minicom
  • socat (man pages of stty and termios can help understanding the tweaks of terminals
socat -,icanon=0,echo=0 /dev/ttyUSB2,raw,echo=0,b9600

With that socat command:

  • echo is ok, colors are supported, arrows also, ctrl-d
  • ctrl-c is local -> exit socat
  • still one problem: F1..F10 don't work in mc, but you can use instead esc-1..esc-9, esc-0 (for F10)

To get ctrl-c working remotely instead of locally:

socat -,icanon=0,echo=0,isig=0 /dev/ttyUSB2,raw,echo=0,b9600

But then socat must be killed externally to quit