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.
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.