-   Linux - Newbie (
-   -   Telnet script?? (

mike400hp 08-22-2003 02:20 PM

Telnet script??
Hello Everyone,
Ok what I am trying to do is setup a script that will launch a telnet session, and prompt for a username and password. I want the users to login to Linux, then instead of having them type in...


I want to have a script that runs automatically when any users logs in. So they enter their Linux username and password, press Enter and it takes them directly to enter their telnet session username and password. I'm new to Linux but I'm trying to save my company thousands and thousands of dollars. Right now about 50% of the computers here use nothing but this little telnet program, connecting to an AIX server. I don't see the point in paying for a full Windows 2000 Professional license for a simple telnet session. I'm going to make another post about how to use MS Active Directory accounts to log into Linux. Thanks for the help with this telnet problem.


david_ross 08-22-2003 02:55 PM

Welcome to LQ.

Why does it need to be automatic. Can't you just get them to telnet once they login? If you want to save even more money you may want to look at thin clients:

Hangdog42 08-22-2003 03:00 PM

I suppose you could add telnet hostname to their .bashrc file. Of course that would mean that they have no choice but to log into telnet when they log into linux.

mike400hp 08-22-2003 03:19 PM

Why I want this
Well, I don't want to go with thin clients because I might want the computers to do other things later on. For right now though, I'm trying to make it as easy as possible on the users. I'm sure you IT guys know that unless you make things easy enough for a two year old to do, some users just won't figure it out. So what would the script look like to get this done?


Hangdog42 08-22-2003 03:25 PM

If they don't already have a .bashrc file, you can create it and then it would look like

#! /bin/bash
telnet hostname

That's it.

If they do have a .bashrc, just add the telnet hostname to the end of the file.

I think some distros may use a .bash_profile instead of .bashrc so you might want to do a bit of checking on which you have.

If this network is in any way exposed to the outside world, dump telnet NOW and move to ssh.

david_ross 08-22-2003 03:25 PM

I don't think there is a way to pass the password automaticcaly without using ssh and authorised keys. You could do as Hangdog said and palace it into the login script. You may want to try it with the -l switch and the $USER variable but this would only work if the telnet server supports this type of login. you would still need to enter the password.

Looking_Lost 08-22-2003 03:41 PM

Maybe there is a way, looking at man telnet it refers to once a connection is made .telnetrc is run in the users home directory which contains a list of commands that are processed as if they were directly typed in, so going with that at first glance it looks possible unless I'm interpreting it wrong which wouldn't be a first :)

All times are GMT -5. The time now is 09:57 PM.