Aleksandar Milivojevic
2006-Aug-18 19:19 UTC
[CentOS] connecting linux console using serial port
Quoting israel.garcia at cimex.com.cu:> Hi, I have a serial modem connected to /dev/ttyS0 on my CentOS server, I > want to set up this server to allow connections through this serial > modem but only to the console.... (I want to log in)... > > PS: I don't want PPP, I just want to get my linux console through this > serial modem... > > What do I have to configure on my linux?Hmmm... Do you want *console* (as in /dev/console) or just terminal access (as in /dev/ttySO)? -- NOTICE: If you are not intended recipient, you are hereby notified that by reading this message you agreed not to disturb frogs during mating season. For more info, visit http://www.8-P.ca/
pctech at mybellybutton.com
2006-Aug-18 19:41 UTC
[CentOS] connecting linux console using serial port
>Quoting israel.garcia at cimex.com.cu: > >> Hi, I have a serial modem connected to /dev/ttyS0 on my CentOS server, I >> want to set up this server to allow connections through this serial >> modem but only to the console.... (I want to log in)... >> >> PS: I don't want PPP, I just want to get my linux console through this >> serial modem... >> >> What do I have to configure on my linux? > >Hmmm... Do you want *console* (as in /dev/console) or just terminal >access (as in /dev/ttySO)? >The easy way is to configure the modem so that it is in Auto-Answer mode all of the time. Once it is in auto-answer mode it will answer when you dial it and then you will see what the is transmitted to it via the serial cable. Then follow the instructions for setting up Linux to use the serial port for output/input. If you don't have that information at your fingertips it is as follows: 2.3 Configuring Headless Operation By configuring ?headless? operating we will be able to manage the system via a cable plugged into the serial port of the system. This obviates the need to plug a keyboard and monitor into it to perform changes. Thus the term ?headless?. 2.3.1 Changes to /etc/inittab The /etc/inittab file contains settings that get applied to the Operating Systems at boot time. There are some changes that need to be made to these settings. In order to edit the /etc/inittab file type: vi /etc/inittab Typing this command will open the /etc/inittab file for editing. As stated earlier the 18th line down is the run level line. Add the following line to the file: S0:12345:respawn:/sbin/agetty 9600 linux This line sets the Operating System to be able to send boot time information to the serial port in addition to the console. After you have made these changes to the /etc/inittab file press the colon (: ) key and then type wq to quit vi and save the changes. 2.3.2 Changes to /etc/securetty The /etc/securetty sets the controls for which TTY devices that the root account can log on via. In order for us to be able to log onto the serial console as root or to be able to su to root we must add a line to the file. In order to edit the /etc/secuertty file type: vi /etc/securetty Typing this command will open the /etc/secuertty file for editing. Add the following line to the end of the file: ttyS0 This line sets the Operating System to allow root to log on to the serial port in addition to the console. After you have made these changes to the /etc/securetty file press the colon (: ) key and then type wq to quit vi and save the changes. 2.3.3 Changes to the Boot Loader In order for boot-time messages to be sent to the console, including the boot loader information some changes must be made to the configuration file for it. The boot loader that CentOS uses is GRUB. As such, the configuration file is /etc/grub.conf. The first change that we must make is to add some lines after the timeout line in the GRUB configuration file. In order to edit the /etc/grub.conf file type: vi /etc/grub.conf Typing this command will open the /etc/grub.conf file for editing. Add the following two lines after the timeout line in the configuration file: serial --unit=0 --speed=9600 terminal --timeout=5 serial console Another change that we must make in the GRUB configuration file is to tell the kernel to send out all kernel-level messages to the serial port in addition to the console. That is done by adding the following line to the end of the kernel line: console=tty1 console=ttyS0 After you have made these changes to the /etc/grub.conf file press the colon (: ) key and then type wq to quit vi and save the changes. Once you have made these changes reboot the system by typing by typing: reboot The system will now reboot.>-- >NOTICE: If you are not intended recipient, you are hereby notified >that by reading this message you agreed not to disturb frogs during >mating season. For more info, visit http://www.8-P.ca/ > >_______________________________________________ >CentOS mailing list >CentOS at centos.org >http://lists.centos.org/mailman/listinfo/centos
israel.garcia at cimex.com.cu
2006-Aug-18 20:00 UTC
[CentOS] connecting linux console using serial port
Hi, I have a serial modem connected to /dev/ttyS0 on my CentOS server, I want to set up this server to allow connections through this serial modem but only to the console.... (I want to log in)... PS: I don't want PPP, I just want to get my linux console through this serial modem... What do I have to configure on my linux? Thanks for your time Regards; Israel
Aleksandar Milivojevic
2006-Aug-18 20:23 UTC
[CentOS] connecting linux console using serial port
Quoting israel.garcia at cimex.com.cu:> Just terminal access -> I want to login in my linux server connecting > through the modem connected in /dev/ttyS0Not sure if this is complete. Install mgetty if not already present on your system. Go to /etc/mgetty+sendfax directory. If you have CallerID feature on your phone line (and you should get it if you don't have it yet), edit dialin.config file and add telephone numbers you will be dialing from. At least this will prevent clueless script-kiddies from getting login prompt on your modem line. I know that some of my modems get regullary probed from strange phone numbers (and those are dedicated modem lines -- no voice calls on them, not listed in white pages, too often on too many lines to be the simple case of wrong number). While there, check login.config file. If you don't want PPP on it, make sure /AutoPPP/ is commented (should be default). Make sure "* - - /bin/login @" line is not commented (should be last line in the default config file). That's the line that will give you login prompt. Edit /etc/inittab and add something like this: s0:2345:respawn:/sbin/mgetty -D -n 2 -s 115200 /dev/ttyS0 The "-n 2" tells mgetty to pick up the phone after second ring. You need to wait till second ring because telephone company sends CallerID information between first and second ring. If you configured mgetty to answer after first ring, it would never get CallerID information. Execute "telinit q" as root (this tells init process to reread inittab file). Configure and connect modem and you should be set to go. I do not recommend allowing root to login directly from modem line (could be configured by editing /etc/securetty and /etc/security/access.conf files if needed, but not wise idea). Login as normal user, than su to root. -- NOTICE: If you are not intended recipient, you are hereby notified that by reading this message you agreed not to disturb frogs during mating season. For more info, visit http://www.8-P.ca/
israel.garcia at cimex.com.cu
2006-Aug-18 20:48 UTC
[CentOS] connecting linux console using serial port
uoting israel.garcia at cimex.com.cu:> Hi, I have a serial modem connected to /dev/ttyS0 on my CentOS server,I> want to set up this server to allow connections through this serial > modem but only to the console.... (I want to log in)... > > PS: I don't want PPP, I just want to get my linux console through this > serial modem... > > What do I have to configure on my linux?>Hmmm... Do you want *console* (as in /dev/console) or just terminal >access (as in /dev/ttySO)?Just terminal access -> I want to login in my linux server connecting through the modem connected in /dev/ttyS0 -- NOTICE: If you are not intended recipient, you are hereby notified that by reading this message you agreed not to disturb frogs during mating season. For more info, visit http://www.8-P.ca -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.centos.org/pipermail/centos/attachments/20060818/b658395f/attachment-0002.html>
Reasonably Related Threads
- connecting linux console using serial port (NOW PPP)
- /etc/inittab: Serial access/ Console Server
- xen 3.3.0 etch sources console hangs
- Xen Virtual Console xvc (Was: Re: Pardon me for possibly dumb question but....)
- Inquiry:External USB modem and Remote PC Access?