Solved

Automate telnet login?

Posted on 1998-07-17
5
369 Views
Last Modified: 2010-04-21
Under one unix box, can I automate the process to login the other unix box?
Thanks.
Shane
0
Comment
Question by:xiaoxiangz
[X]
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
5 Comments
 
LVL 2

Expert Comment

by:mlev
ID: 2008853
Specifically what part of it do you want to automate?
Do you want to be able to type "login_there" and get
a prompt on the remote machine? Or click on an icon in
your WM and have it open an xterm running telnet? Or...?
0
 
LVL 1

Expert Comment

by:Rajkumar_R
ID: 2008854
See man pages for telnet and telnetrc .....if you want to happen it automatically then you should put a script inside .profile which will call telnet
0
 

Author Comment

by:xiaoxiangz
ID: 2008855
Sorry for not being clear. By saying automate telnet, I mean not
type in login name and username everytime. Instead put in a file.
Thanks.
Shane

0
 
LVL 1

Accepted Solution

by:
chytrace earned 20 total points
ID: 2008856
Hi,

  try the following expect script:

-------------- cut here ----------------------------
#!/share/bin/expect -f

spawn telnet host_name
expect "ogin:"
send "your_login\r"
expect "ssword:"
send "your_password\r"
interact
----------------- cut here ----------------------

Hope this helps, for more see 'man expect'.

                Radovan

0
 

Expert Comment

by:ShootThemLater
ID: 2008857
You can try using expect to automate the 'conversation' with the box at the other end and pass it UID etc.

Alternatively, you can look into rlogin.  Check out man 5 rhosts...
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

688 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