Next Previous Contents

42. Dial-in terminal / PPP access via a modem

NOTE: There are several "gettys" out there and it isn't totally clear on how they are different. But, here is a little snipet from /usr/doc/getty_ps-2.0.7j/README.hi-speed:

                 I've only tested uugetty on dialin lines (with a Zoom v34X 36.6K) at
                 57.6 and 115.2Kbps.  I generally use agetty for dumb terminals,
                 mingetty for the console, and faxgetty calling agetty for combination
                 fax/data lines. (hylafax)

- edit /etc/inittab

Redhat: - Find the line that says: "6:2345:respawn.." and copy it to also say (for a modem on COM1):

                                "7:23456:respawn:/sbin/uugetty ttyS0 38400 vt100"

- Create the file /etc/default/uugetty.ttyS0 (for dial-ins on COM1)

NOTE: This config assumes you are using a modem on COM1, that it is going to answer the phone after -6- rings and before the user is shown a "Login:" prompt, the user will have to blindly enter in the password "letmein".

                # [ put this file in /etc/default/uugetty.<line> ]
                # sample uugetty configuration file for a Hayes compatible modem to allow
                # incoming modem connections
                # this config file sets up uugetty to answer with a WAITFOR string.  When
                # using waitfor, it is necessary to specify INITLINE=cua?
                # line to use to do initialization.  All INIT, OFF, and WAITFOR functions
                # are handled on this line.  If this line is not specified, any other
                # program that wants to share the line (like kermit, uucp, seyon) will 
                # fail.  This line will also be checked for lockfiles.
                # format: <line> (without the /dev/)
                # timeout to disconnect if idle
                # modem initialization string: Sets the modem to disable auto-answer
                # format: <expect> <send> ... (chat sequence)
                #INIT="" \d+++\dAT\r OK\r\n ATH0\r OK\r\n AT\sM0\sE1\sQ0\sV1\sX4\sS0=0\r OK\r\n
                INIT="" \d+++\dAT\r OK\r\n ATH0\r OK\r\n ATS0=6\r OK\r\n
                # waitfor string: if this sequence of characters is received over the line,
                # a call is detected.
                # this line is the connect chat sequence.  This chat sequence is performed
                # after the WAITFOR string is found.  The \A character automatically sets
                # the baud rate to the characters that are found, so if you get the message
                # CONNECT 2400, the baud rate is set to 2400 baud.
                # format: <expect> <send> ... (chat sequence)
                #CONNECT="" ATA\r CONNECT\s\A

                # this line sets the time to delay before sending the login banner

- Finally, make sure your modem is connected and powered up and now tell Linux to initialize the modem with:

                /sbin/init q

That's it. Go ahead, dial in with a modem and let it RING (6) times. After the sixth ring, the modem should answer and you should then be dropped to "nothing". Now blindly type in "letmein" and you should then see a normal Linux "login:" prompt.

42.1 For PPP connectivity:

To do your work via PPP instead of doing it via a standard terminal, follow the PPP setup recommendations in Section 22. Then, after you successfully login and are dropped to a UNIX prompt, simply type in the following (for a modem on COM1):

                        /usr/sbin/pppd /dev/ttyS0 38400

NOTE: Many of you would probably rather have Linux default to a PPP only mode. To me, this is far more inflexiable and what happens if you aren't on a system that doesn't have PPP functionality? Doing it this terminal-->ppp way is MUCH more flexible.

42.2 Dialing in with answering machines:

- The following is VERY dependant on your home answering machine -

If you are like me, you only have one phone line and there is an answering machine on that line that answers the phone around call 3 or 4. To get past this, I can get into my answering machine remotely and turn it OFF. Once off, the linux's modem will answer after -6- rings. Once I'm done dialing in, I TEMPORARILY disable uugetty in /etc/inittab, rerun "/sbin/init q", and then re-call my answering machine with 15 rings. After that, the machine will turn back on. Once this is set, you'll need to re-enable uugetty in the /etc/inittab file and rerun "/sbin/init q" from a TELNET/SSH connection.

With that all behind you, if you ever make a mistake editing your IPFWADM rule sets, your Inet connection is down, etc, you now have a secured BACKDOOR into your machine!

Next Previous Contents