Solved

Automate telnet login?

Posted on 1998-07-17
5
366 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
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

ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

Question has a verified solution.

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

FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
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 several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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…

831 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