How to read userid and password information from txt file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to read userid and password information from txt file
# 1  
Old 12-09-2011
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 for daily cron job run.
How I can modify this shell script to read the userid and password information from txt file ?

PS : All my 15 servers are on SunOS.
uname -v
Generic_118558-27

Thanks,
Ajay
# 2  
Old 12-09-2011
search in this forum for "password less ssh"

you need to install your server public keys in all the 15 servers ( for password less connectivity )
# 3  
Old 12-09-2011
yes I know about this option ...but do we have any option wherein we can read password from .txt file.

Quote:
Originally Posted by itkamaraj
search in this forum for "password less ssh"

you need to install your server public keys in all the 15 servers ( for password less connectivity )
# 4  
Old 12-09-2011
use expect...
# 5  
Old 12-12-2011
can you please explain with e.g. similar to my request . will this approach work at SunOS ?

Quote:
Originally Posted by itkamaraj
use expect...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Extract information from txt file

Hello! I need help :) I have a file like this: AA BC FG RF TT GH DD FF HH (a few number of rows and three columns) and I want to put the letters of each column in a variable step by step in order to give them as input in another script. So I would like to obtain: for the 1° loop:... (11 Replies)
Discussion started by: edekP
11 Replies

2. UNIX for Dummies Questions & Answers

How can i sort a .txt file without loosing the header information?

Hi, I'm trying to sort 2 different .txt tab delimited files with the command line: sort -k 1b,1 inputfile > outputfile But doing that i'm also sorting the header (that ends at the end of my file). How can i sort a .txt file without sorting the header but conserving the header in the... (3 Replies)
Discussion started by: alisrpp
3 Replies

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

4. AIX

AIX 5.3 userid password length to 6

Hi All, How can I make the password of only two userid with 6 length while others are using regular policy of 8 or more length. Please help. Thanks. (2 Replies)
Discussion started by: itik
2 Replies

5. Shell Programming and Scripting

i need to read the last line in a txt file

i'm a beginner in shell and i have a txt file that is updating every second or msec so i need a program to read the last line of this txt file is this possible to do? (5 Replies)
Discussion started by: _-_shadow_-_
5 Replies

6. UNIX for Dummies Questions & Answers

can't read a .txt file

Hello, I have a set of .txt files I cannot read. This is a part of what I see. Is there a way to view these files? _MO<P.6D@K;WU<B$X-;)SIV/ROO!UL+1P=VTT-?,SLC`MI/6QMS#UYGGT\+)C=#\UIO`TL/0]=#/T) it's about 3 pages. Thanks for your help. Joe (3 Replies)
Discussion started by: rcracerjoe
3 Replies

7. UNIX for Dummies Questions & Answers

How to read from txt file and use that as an array

Hi Guys How u all doing? I am having tough time to achieve this I have a unix .ksh script which calls sql script Right now I harcoded column id's in sql script but I want to read them from a txt file 1084,1143,1074,1080,1091,1090,1101,1069,1104,1087,1089,1081 I want to read this... (4 Replies)
Discussion started by: pinky
4 Replies

8. Shell Programming and Scripting

read a part of information from txt and put into the script

Hi, I have a name.txt which is stored: APPLE ORANGE RED BLUE GREEN and my script is: $name=`cat name.txt for file_number in `ls 1 /appl/CH_DATA/archive/CACHE/CDBACKUP$name*.archived however, my script cannot read name.txt and put into my scrip line, I would like the output is to... (18 Replies)
Discussion started by: happyv
18 Replies

9. AIX

UserID password validation using C program

I am new to AIX. I was wondering if there is a security API on AIX which I can call from my C program to validate the userID and password of a user. My plan is to have my C program prompt the user for UserID and password. I'll then call the AIX security API to determine what authority the user... (1 Reply)
Discussion started by: AIX_user
1 Replies

10. UNIX for Dummies Questions & Answers

How to read last line of a txt file?

I need to read the last file for a particular day, such as, "Jun 13" because the CSV file is cumulative for the entire day, so I don't want all the previous files, I just want the last file, for that day. I ran an 'ls -al | grep "June 13" > myLs.txt' (simplified) to list all files from that day.... (2 Replies)
Discussion started by: yongho
2 Replies
Login or Register to Ask a Question