Use rsh or ssh -

system "rsh -l $username $hostname ls";

for the above to wrk without a password, your client machine's hostname
must be in $username's .rhosts file.

Better yet, use ssh with RSA or DSA authentication - then you won't be
exposing your password in plaintext.

There's also a Net::SSH module out there.


On 10 Jul 2001, Jie Meng wrote:

> Dear all,
>
> I plan to write a simple remote connection script, and then "ls" the content
> of the current directory, input like
>
> telnet hostname
> username
> password
> ls
>
> I use the following script:
>
> system ("telnet hostname");
> <STDOUT> = "username\n";
> <STDOUT> = "password\n";
> system ("ls");
>
> It failed in the <STDOUT> syntax.
>
> Can anyone kindly give me a hint?
>
> Thanks,
>
> Jie
>
> ____________________________________________________________________
> Get free email and a permanent address at http://www.amexmail.com/?A=1
>

Reply via email to