Solved

Automate telnet login?

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
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…
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 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…

839 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