Route to a different machine

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
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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.
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.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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.

CompTIA Network+

Prepare for the CompTIA Network+ exam by learning how to troubleshoot, configure, and manage both wired and wireless networks.

bross073097Author Commented:
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

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.

bross073097Author Commented:
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
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.

bross073097Author Commented:
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

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@
bross073097Author Commented:
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

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").
bross073097Author Commented:
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

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Networking

From novice to tech pro — start learning today.