How To Read A File Remotely Without A Password?

Many thanks to anyone who can help me solve this problem I am having:

I am working on an HP-UX system version B.11.11 and I have been tasked with finding a way to read a file on a remote server (cat, grep, etc.) using a specific userID without copying it or moving it to the local machine.

But, it has to be done automatically as part of a ksh script. That means it cannot stop and ask for a password which is something that REMSH or REXEC seem to require even after I added the user to the .rhosts file.

I am not a systems administrator so I do not have the ability to make any security modifications that might permit this behavior to the server. Nor can it be run as root. In fact the script will begin from a session that will usually be owned by a user with very limited access, then jump to a different userID to make the remote access attempt. Additionally, management doesn't want to request a change to the server because I was told that would make us dependent upon the admins for support and prevent the script I am designing from being truly self-sufficient.

They actually prefer (believe it or not) to hardcode the password for the userID involved into the script. I advised against this due to the security risk but they really want this script to be self contained.:rolleyes:

Here are some pseudo examples that I have tried (unsuccessfully) to make work within the narrow parameters that I have been allowed:

rexec <remote server> <username> <password> "cat <filename>"
su <username> <password> -c "remsh <remote server> cat <filename>"

I really feel like I'm kinda stuck between a rock and a hard place and I have run out of ideas. :confused:

I hope someone here can help. Thanks in advance.:slight_smile: