The phone number can be dial in, but it cannot be displayed on the linux interface.

Source: Internet
Author: User
Tags telnet program
The phone number can be dial in, but it cannot be displayed on the linux interface-general Linux technology-Linux technology and application information. The following is a detailed description. The phone number can be dial in, but it cannot be displayed on the linux interface.

Enable linux to receive incoming calls

To implement this function, you need to use a program named getty. Its function is to display a logon prompt like login: And password: to the user, and call the login program for logon. We usually use telnet to log on to a unix host in the LAN. But now we use different physical lines. We use the telephone line> modem> serial port, while the telnet program uses the network cable and network card.

Currently, there are three types of getty in linux: getty_ps, agetty, and mgetty. Getty_ps is getty. The other two methods also implement the getty function. Among them, mgetty has powerful functions, so we decided to use mgetty.

RedHat6 contains four software packages of mgetty, The mgetty-1.1.14-8.i386.rpm is required to be installed, if you want to use the callback function, you need to install the mgetty-sendfax-1.1.14-8.i386.rpm, the callback program is included in this package (do not understand why in this package ). I don't care so much about it, rpm-Uvh mgetty *, and install it all.

What we need to do now is to make the serial port connected by the modem accept external connections.

Use the chmod command to write and delete the/etc/inittab file.
Open the/etc/inittab and you will see the following lines:

# Run gettys in standard runlevels

1: 2345: respawn:/sbin/mingetty tty1

2: 2345: respawn:/sbin/mingetty tty2

3: 2345: respawn:/sbin/mingetty tty3

4: 2345: respawn:/sbin/mingetty tty4

5: 2345: respawn:/sbin/mingetty tty5

6: 2345: respawn:/sbin/mingetty tty6

Add the following line after the rows:

7: 2345: respawn:/sbin/mgetty ttyS1

It means that mgetty listens to ttyS1 on the serial port and waits for the connection. If there is a connection request, mgetty will prompt the user with the username and password. Mgetty also has many parameters. For more information, see the mgetty manual page. Note: The program name is megtty rather than the mingetty written in the above lines. Mingetty is the terminal program of RedHat. It does not support modem connection. One of my colleagues typed mgetty into mingetty by mistake, but linux didn't answer the call. In addition, the number "7" at the beginning of this line is not certain. As long as it is not duplicated in the file, it is unique. It can be two characters or numbers.

After modification, make the modification valid and run:

Init q

In order to log on from the remote end, we need an account, add a user called ppp using the useradd command, and set a password for it using the passwd command.

Next, we will try it with the win95 client. We will create a new connection under win95. The phone number must be correct and right-click the connection, select Properties> General> Settings> options, tick "terminal window displayed after dialing", and then click "OK" to close the dialog box. Double-click the connection. You do not need to fill in the user name and password. Simply press "Connect". You will hear the dialing sound and a burst of buzz, and a black-white window will pop up, this is the terminal window for Logon! You will see that this is the same as when you log on to linux. Enter the user name ppp and password. What you see is the shell prompt. You have logged on to the linux host through modem! However, this form of terminal Internet access is not a ppp connection. I believe you will not be satisfied. What you need is a network with abundant functions such as WWW and FTP. Let's take a look at how to implement the ppp connection. Now, at the shell prompt, enter exit to exit.


Problem description:
The following error occurs when running init q:
E492: Not an editor command:/sbin/init q

The client displays that the connection is successfully established by dial-in, but the terminal window for login is invisible.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.