=======================
O2 As Serial Console: HOWTO
=======================
Edit 'inittab':
Edit '/etc/inittab' To Disable 'getty' On "Port 2":
If the third field in the line is the word 'off' (as in the example above), exit the file and continue with next step.
If the third field is the word 'on', change it to 'off'. Then save the file, exit, and at the shell prompt enter this command:
telinit q
Edit 'Devices':
Edit '/etc/uucp/Devices' To Enable A Direct Line On "Port 2":
Edit 'Systems':
Edit '/etc/uucp/Systems' To Enable Direct Connections On Any Time:
Resultant Device Settings: [9600 8N1]
cu Syntax:
...Or Simply:
cu Conversation Commands:
O2 As Serial Console: HOWTO
=======================
Edit 'inittab':
Edit '/etc/inittab' To Disable 'getty' On "Port 2":
Code: Select all
t2:23:off:/sbin/suattr -C CAP_FOWNER,CAP_DEVICE_MGT,CAP_DAC_WRITE+ip -c "exec /sbin/getty -N ttyd2 co_9600" # port 2
If the third field in the line is the word 'off' (as in the example above), exit the file and continue with next step.
If the third field is the word 'on', change it to 'off'. Then save the file, exit, and at the shell prompt enter this command:
telinit q
Edit 'Devices':
Edit '/etc/uucp/Devices' To Enable A Direct Line On "Port 2":
Code: Select all
Direct ttyd2 - 9600 direct
Edit 'Systems':
Edit '/etc/uucp/Systems' To Enable Direct Connections On Any Time:
Code: Select all
Direct Any Direct 9600 -
Resultant Device Settings: [9600 8N1]
-
9600 baud
8 Data bits
No Parity
1 Stop bit
cu Syntax:
Code: Select all
cu -d -s 9600 -l /dev/ttyd2
...Or Simply:
Code: Select all
cu Direct
cu Conversation Commands:
man cu wrote: ~.
terminate the conversation.
~!
escape to an interactive shell on the local system.
~!cmd...
run cmd on the local system (via sh -c).
~$cmd...
run cmd locally and send its output to the remote
system.
~^Z
suspend the cu session. (^Z, control-Z, is the
current job control suspend character (see csh(1) and
stty(1)).
~%cd
change the directory on the local system. Note:
~!cd will cause the command to be run by a sub-shell,
probably not what was intended.
~%take from [ to ]
copy file from (on the remote system) to file to on
the local system. If to is omitted, the from
argument is used in both places. The shell commands
below are sent to the remote machine to cause it to
transmit the file. In fact, they are sent in a
single line with semicolons (;) between each command.
stty -echo
if test -r arg1; then
(echo '~>':arg2;cat arg1;echo '~>')
else
echo cant\'t open: arg1
fi
stty echo
~%put from [ to ]
copy file from (on local system) to file to on remote system. If to
is omitted, the from argument is used in both places.
For both ~%take and put commands, as each block of the file is
transferred, consecutive single digits are printed to the terminal.
The shell command line below is sent to the remote machine to cause
it to accept the data. Obviously, the shell on the remote machine
must be /bin/sh or a shell that correctly interpret these commands.
stty -echo;(cat - > arg2)||cat - >/dev/null;stty echo
~~ line
send the line ~ line to the remote system.
~%break
transmit a BREAK to the remote system (which can also be specified
as ~%b).
~%debug
toggles the -d debugging option on or off (which can also be
specified as ~%d).
~t
prints the values of the termio structure variables for the user's
terminal (useful for debugging).
~l
prints the values of the termio structure variables for the remote
communication line (useful for debugging).
~%nostop
toggles between DC3/DC1 input control protocol and no input control.
This is useful in case the remote system is one which does not
respond properly to the DC3 and DC1 characters.