rlogin

Hi all,

i need to remotely execute a couple of commands on anyother server, but rsh is not allowed. for that matter i am bound to use rlogin. so what i am trying to do in the script is :

1) rlogin asad
2) Wait for Login prompt
3) Waiting for Password Prompt
4) Once authenticated, execute the couple of commands and exit

i am stuck in the (2) and (3) point. how can i make a script wait for a username login prompt and then give it value from the script and then the password prompt and supply the way from the script.

Pl help me out in this. thanks

If rsh is not allowed, why do you think rlogin is any better?

Can't you use ssh instead?

hi ... well i will use ssh but it ask for password on prompt and i have to include that in the script. so can u guide me with that.

There are various ways to avoid passwords in ssh. The secure and reasonably simple way is to run public-key authentication with a key which is known by your ssh-agent; a weaker but even simpler solution is to have a key which doesn't require a password, but I'd recommend against that.

You can use expect script for that matter
expect script + ssh is better option rather then pre auth.