batched rlogin

I want to write a batch file that issues the rlogin command with the username and password. Is there a way to pass a user password to the rlogin command?

Thanks.

Not directly, but the same thing can be accomplished with the use of an .rhosts file. See the rlogin man page for details. Standard disclaimer applies: rlogin is totally insecure. Consider using ssh instead.

I don't remember exactly what is the link, but if you search through the forums for rlogin you will find some useful info on rlogin since this was discussed recently.

Hope this helps you

:slight_smile:

There is a way you can do this with rlogin, telnet, ftp, ssh by writing a script in Expect. Expect if a great way to automate any task, and you can write an extremely basic login script in Expect that doesn't require too much time to learn.

Just remember that all concerns about secrutiy should be addressed before using any login script in Expect.

Any and all login scripts are flawed in the sense that the password is hard-coded, usually in plain text. That is a very common way for a cracker in your account/machine to spread their access to other places...

Say, for example, someone gets lucky and hits your account, or worse yet, the root account. It's a simple search to find files with passwords, then take those accounts too...

True, this is also true for SSH using a public key with a null password or equivalence file. You are basically relying on the security setup of you local computer to shield your remote computer.

Depends on how confident you are and how willing you are to suffer a security breach. If a security breach on the remote computer will be devistating than don't use login scripts.