Linux needs all of the flow control and modem control signals to be correctly wired. The correct wiring of a null modem cable is shown in Figure 11-1.
Linux uses CTS and RTS to do handshaking, preventing the computer from overrunning the terminal and preventing the terminal from overrunning the computer. If you are connecting two computers together, then you will not get reliable file transfers without CTS/RTS handshaking.
Linux uses DSR and DCD to sense that a terminal is connected. It will then request a login. If a session is established and DCD falls then Linux will log out the user.
Linux uses DTR to force the link to be cleared. It does this after a user logs off to free up the communications channel.
Major security exposures can occur with incorrectly wired null modem cables.
Figure 11-1. Null modem cable with full status and handshaking
Signal ground ---------------------- Signal ground Receive data ---------------------- Transmit data Transmit data ---------------------- Receive data Ready to send ---------------------- Clear to send Clear to send ---------------------- Ready to send Data terminal ready -----------------+---- Data carrier detect | +---- Data set ready Data carrier detect ----+----------------- Data terminal ready | Data set ready ----+ Ring indication -- not connected not connected -- Ring indication |
There are two ways of defeating the RS-232 handshaking: software and hardware.
Figure 11-2. Null modem cable with falsified status and handshaking
Signal ground ---------------------- Signal ground Receive data ---------------------- Transmit data Transmit data ---------------------- Receive data Data terminal ready ---+ +--- Data terminal ready | | Clear to send ---+ +--- Clear to send | | Data carrier detect ---+ +--- Data terminal ready | | Data set ready ---+ +--- Data set ready Ready to send -- not connected not connected -- Ready to send Ring indication -- not connected not connected -- Ring indication |
Figure 11-3. Null modem cable with no status or handshaking
Signal ground ---------------------- Signal ground Receive data ---------------------- Transmit data Transmit data ---------------------- Receive data |