Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Route to a different machine

Posted on 1997-08-05
Medium Priority
Last Modified: 2010-03-18
I had asked how to have a dial in on (Machine #2) and really be loging in on (Machine #1), I was told to have machine #2 refuse all logins and route everything to machine #1.

How do I set it up so that 4 modem lines that are set for auto answer on Machine #2 have those lines route to Machine #1 and have users login on machine #1 not machine #2.

I Use Linux 2.0.28 on machine #1 and 2.0.0 on #2. I have been looking at rlogin a little to do this, but would like it a bit more smooth so I wouldn't have to try and get the older users new scripts to handle the extra login.

I don't know much about things that are told to do this with out much detail. Please provide detail or location of detail that will provide enough explanation to get it working.

Bob Ross
Question by:bross073097
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 1585837
bross, one important question first. How are you dialing in? Are you using dip?
A quick suggestion - have the users initial shell command in /etc/passwd call rlogin and move the login scripts to the new system.

Accepted Solution

bcook earned 90 total points
ID: 1585838
If you are just talking about terminal session logins to machine
#1, not PPP or SLIP dialups, then it means you're effectively treating machine #2 as a terminal server.

Simplest way is to set the program in /etc/inittab for those
dialin lines to somthing like:

S1:2345:respawn:/usr/bin/telnet machine1
S2:2345:respawn:/usr/bin/telnet machine1

What this would acheive is to run "telnet machine1" for each
serial line instead of the nornal getty process.

If you have a look at the serial.HOWTO you will see that you need to create an entry in /etc/inittab for each serial (dialup) line that you add to the system.


Expert Comment

ID: 1585839
I'm not sure about this....

If you run telnet from inittab, as suggested, then you have no getty process. If this is the case, would those serial lines accept input at all, or would you just have a 'closed off' telnet session that you would never be able to access ??

I'd have to check myself to be sure though - maybe this will work ok.

As I see it, oyu have to go in one of two ways - set machine one up as a terminal server, or as a PPP server.

Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.


Author Comment

ID: 1585840
Well the PPP is hard to say because I'm not sure of what this involves setting up this second machine to do what I would like it to do. But yes they will use it, after they dial in on machine 2 and login on machine 1 they get to the internet.

I did set S1:2345:respawn:/usr/bin/telnet machine1

It telnets before any one connects to the modem, and when they do connect to the modem, it just gives them a blank screen.

Bob Ross


Expert Comment

ID: 1585841
Sorry I forget two critical bits:

S1:2345:respawn:/usr/bin/telnet machine1 </dev/ttyS1 >/dev/ttyS1

(It needs to know what to talk to)

getty is only importany for setting up a login session.

To set up an automatic PPP connection on the line you would do that same thing, only using PPPD.  You'd have to experiment at the command line to see what switches you'd need to give PPPD, and add those to the command line in inittab.

This would be better as it would allow the users full access to your other machine, not just telnet but ftp, etc also.

Another thing would be to create a script that runs on those ports (using inittab again), prompts the user for PPP, TELNET, and then execs the apropriate program.  (You use exec so that there are not other security degrading things hanging onto that port, and when they exit, init will automatically set up your
script for you again).

* The only possible problem is telnet interfering with the modem.
this should be fixed by setting the port's modem control up properly.


Author Comment

ID: 1585842
You now added something new to me.  I'm not sure on, how to put PPPD in the inittab. I have pppd in a shell under ppp, but have no idea to get it in inittab.

If this gets working I will have to increase the points.

Bob Ross

Expert Comment

ID: 1585843
OK, try the telnet bit first.

The shell command you use for pppd (that dialin users use to start their ppp connection) should be able to be used as-is in the inittab entry (Make sure you get the device name parameter right)

Post your pppd command here, and I'll see if there's anything you would need to change.


Author Comment

ID: 1585844
OK the telnet first, I have even tried putting this as a dialin (d1) but the the difference is the system hangs up on them as soon as they connect.

Heres what I have in inittab

s1:respawn:/bin/telnet </dev/ttyS1>/dev/ttyS1

no prompt from

the system still telnets to before any modem connection then the machine 1 times out the telnet because no one is there, and then respawned again.

Bob Ross


Expert Comment

ID: 1585845
hmm.. looks like it's not obeying the tty status.

I've done this before. As sauron pointed out you need getty.
The reason for this is so that you have your line answered properly.

What we need to do is set getty up on the port, and get it to
then pass off to a script rather than login.


s1:respawn:/sbin/getty -d /usr/TEST/getty.params /dev/ttyS1 38400 vt200


exec telnet

The reason for using a shellscript is that getty will put a username into the argument list.  Also it will allow us to put the more complex pppd line into the thing later on.

We may need to use bash to get exec to work. (#!/bin/bash)

We use exec here so that if anything happens (telnet exits, or
the shell script is stopped), init will automatically restart getty.

To continue this in real time,
mail me
or right now,   talk  bruce@

Author Comment

ID: 1585846
We have the machine routing to machine one using a modified getty, It brings up the login prompt of machine one, sends the user name, but this is where it stops. It will not send a return key, it will allow you to type more after the user name but not the return key. Any one have any Ideas please send them. I have been tring them all.

Bob Ross

LVL 51

Expert Comment

ID: 1585847
Your return may be lost in one of those ttys, probably /dev/ttyS1.
Try a different entry in /etc/gettydefs for "38400", see man gettydefs for details (linux's man page is not very informable, it misses all the cool things to do with /etc/gettydefs, see man stty for values to add to the "initial-flags" and "final-flags").

Author Comment

ID: 1585848
I have been tring a lot of different settings in the gettydefs. Is there anyone that might be able to give us some ideas what should be in there to fix the final problem were having.

Bob Ross


Featured Post

Optimum High-Definition Video Viewing and Control

The ATEN VM0404HA 4x4 4K HDMI Matrix Switch supports 4K resolutions of UHD (3840 x 2160) and DCI (4096 x 2160) with refresh rates of 30 Hz (4:4:4) and 60 Hz (4:2:0). It is ideal for applications where the routing of 4K digital signals is required.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question