making script

hello experts
cany any one help me i want to make one script which can rlogin to another machine .
but it should not ask me username/password from me of another machine it should take the username and password from the script only.
please help me out.
regards,
shary

Have a look at the expect tool.

or use ssh.

Set up .ssh/authorized_keys on the server, provide a private certificate on the client.