Automate telnet login?

Under one unix box, can I automate the process to login the other unix box?
Thanks.
Shane
xiaoxiangzAsked:
Who is Participating?
 
chytraceConnect With a Mentor Commented:
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
 
mlevCommented:
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
 
Rajkumar_RCommented:
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
 
xiaoxiangzAuthor Commented:
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
 
ShootThemLaterCommented:
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
All Courses

From novice to tech pro — start learning today.