How To Read A File Remotely Without A Password?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How To Read A File Remotely Without A Password?
# 1  
Old 03-12-2008
Question 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.Smilie

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

I hope someone here can help. Thanks in advance.Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Emergency UNIX and Linux Support

Read password from a file

Hello Gurus, This is something i need to implement quite urgently. My requirement is as follows: 1. We are using Solaris 10, Sun Access Manager appln. 2. we need to start a domain through script (automated). Syntax of the command goes as below: ./asadmin start-domain --user admin domain1 ... (7 Replies)
Discussion started by: EmbedUX
7 Replies

2. Shell Programming and Scripting

Shell Script to Automatically Read My Password

I have a shell script to run set of commands every week . I dont have a root access on the server but I can run the commands using pbrun cat myscript.sh * * * pbrun command.... each time I run the script , it asks me for my password then it executes fine. ./myscript.sh Password... (7 Replies)
Discussion started by: Sara_84
7 Replies

3. Shell Programming and Scripting

How to read userid and password information from txt file

Hi Experts, I am writing a shell script (for displaying disk space details) which is logging to 15 different servers using following command. ssh userid@servername It is prompting me for password for all 15 servers when I manually run it. However , soon I would like to schedule this script... (4 Replies)
Discussion started by: ajaypatil_am
4 Replies

4. Shell Programming and Scripting

Change root password remotely

Hi All, Hope you all doing well...!!! First of all i will like to share few information about my network. I have a network of 50 solaris servers sample IPs are (10.2.135.1 to 10.2.135.50).. i have created trust for root user of servers 1(10.2.135.1) in all other servers, that is i have shared... (4 Replies)
Discussion started by: varunksharma87
4 Replies

5. Shell Programming and Scripting

Read userid and password

Am reading userid and password. code: pmsg "Enter the userid \n" read userid pmsg "Enter password \n" read password pmsg "Enter Database name \n" read database When user type password, it a clear text. I want something like ******** or just a blank any suggestion plz... ... (2 Replies)
Discussion started by: ilugopal
2 Replies

6. Red Hat

Change password of linux servers remotely

Hi, I am very bad at scripting. I need help from scripting experts... I need to change password of around 100 linux remote servers. I have been given a script for changing the password that automates the task. however I do not understand the usage and meaning of the script, the script is an... (0 Replies)
Discussion started by: renuka
0 Replies

7. Shell Programming and Scripting

Test File Existance Remotely?

Thanks in advance to anyone that can help me answer this: I'm trying to write an if statement that will run test -f on whether a file exists on another server and if it does not then report that negative outcome to a log file. I'm thinking it should look something like this: if ; then rcp... (5 Replies)
Discussion started by: Korn0474
5 Replies

8. Shell Programming and Scripting

Read Oracle Username password SID from single file and pass it to shell

Dear All I am trying to write one shell which will be running through Cron which contain one SQL query. But I want to draw/fetch the Username password and Instance name (required to loging to the database) from one single file to run that SQL query . Also this file contain details of multiple... (2 Replies)
Discussion started by: jhon
2 Replies

9. UNIX for Advanced & Expert Users

using ssh change password remotely?

Is it possible to change the password using a shell script, I want to remotely connect to a computer and then change password without manual intevention. Thanks in Advance Rishi (4 Replies)
Discussion started by: RishiPahuja
4 Replies

10. UNIX for Dummies Questions & Answers

Running UNIX commands remotely in Windows box from Unix box – avoid entering password

I am able to run the UNIX commands in a Windows box from a UNIX box through "SSH" functionality. But whenever the SSH connection is established between UNIX and Windows, password for windows box is being asked. Is there a way to avoid asking password whenever the SSH connection is made? Can I... (1 Reply)
Discussion started by: D.kalpana
1 Replies
Login or Register to Ask a Question