LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-22-2003, 03:20 PM   #1
mike400hp
LQ Newbie
 
Registered: Aug 2003
Posts: 8

Rep: Reputation: 0
Question 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...

telnet
open 192.168.0.1
username
password

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.

Michael
 
Old 08-22-2003, 03:55 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
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:
http://www.ltsp.org
 
Old 08-22-2003, 04:00 PM   #3
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 416Reputation: 416Reputation: 416Reputation: 416Reputation: 416
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.

Last edited by Hangdog42; 08-22-2003 at 04:01 PM.
 
Old 08-22-2003, 04:19 PM   #4
mike400hp
LQ Newbie
 
Registered: Aug 2003
Posts: 8

Original Poster
Rep: Reputation: 0
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?

Thanks,
Michael
 
Old 08-22-2003, 04:25 PM   #5
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 416Reputation: 416Reputation: 416Reputation: 416Reputation: 416
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.

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

Last edited by Hangdog42; 08-22-2003 at 04:27 PM.
 
Old 08-22-2003, 04:25 PM   #6
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
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.
 
Old 08-22-2003, 04:41 PM   #7
Looking_Lost
Senior Member
 
Registered: Apr 2003
Location: Eire
Distribution: Slackware 12.0, OpenSuse 10.3
Posts: 1,120

Rep: Reputation: 45
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
can we telnet the system using shell script suchi_s Programming 18 02-18-2005 03:43 PM
telnet script help GUIPenguin Linux - General 2 01-16-2005 03:48 PM
Telnet script pirra Programming 1 12-29-2004 04:04 PM
telnet script tn1681 Linux - General 3 07-25-2002 11:09 PM
telnet script tn1681 Programming 2 07-24-2002 09:47 PM


All times are GMT -5. The time now is 06:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration