Supply Password Thru Script

Thread Tools Search this Thread
Operating Systems AIX Supply Password Thru Script
# 1  
Old 02-27-2008
Supply Password Thru Script

I am using AIX 5 and one of the application does certain db updation daily and runs few script. One script among them calls another program, which in turn asks for a user Id and password. Is there anyway to use 'expect' of something similar on AIX so that while calling that program of userid and password - its get passed automatically and no interaction could take place.

1) Please let me know what piece of code can I merge into my existing script to automate it?
2) IF expect works on AIX, i dont see it in /usr/bin - where to find that?

Please help!
# 2  
Old 02-27-2008
I think it is less a question of using a specific tool but a question of how the application handles its input.

If the application asks for the password and then expects <stdin> to provide it you might be able to use one of the following constructs:

app < $(print - "<password>")
print - "<password>" | app
app < /file/with/password
cat /file/with/password | app

But with ssh (for instance) this would fail. Secure Shell doesn't use the regular <stdin> due to security reasons and you will have to provide the password either by exchanging keys (to speak generally: by applications means) or by hand. If your application falls into the same category all the ways mentioned above will fail.

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Supply passphrase for ssh in script

I would like to write a bash shell script which will connect to remote server using passphrase. (I have public-private infrastructure created, and as per instruction, I must not use password less ssh). This particular script will be fired from cron. Can you please advice how I can supply the... (2 Replies)
Discussion started by: atanubanerji
2 Replies

2. Solaris

Strange power supply units alarms!!!

Hi folks, I encountered this alarms on a solaris server: 04/21/12 23:17:55 MNP-PGW-A_bge3 mnp 231748 Power Supply Unit 0 is faulty 04/21/12 23:17:55 MNP-PGW-A_bge3 mnp 231748 Power Supply Unit 1 is faulty 04/21/12 23:18:26 MNP-PGW-A_bge3 mnp 231822 Power Supply Unit 0 is faulty:CLEAR... (0 Replies)
Discussion started by: kimurayuki
0 Replies

3. Shell Programming and Scripting

how to supply arguments for a script while ssh to a server

Hi, I have something like below code piece in ksh while read machine do ssh $user@$machine < steps.ksh $RPI done < $machine here, after it gets logged in to server it is not considering the $PRI as argument for steps.ksh script please suggest the fix. (1 Reply)
Discussion started by: rbalaj16
1 Replies

4. AIX

Finding Power Supply Status

Hi, As in Management Modules of IBM it is possible to find out wheather out of dual powersupply , if one goes down. is it possible to find out in HMC to find out if one power supply goes down of P Series server? if server is remotely HOw to find out if one power supply of server is down?... (1 Reply)
Discussion started by: manoj.solaris
1 Replies

5. Shell Programming and Scripting

supply password to scp with out interacting

Hi, I am trying to supply password to scp with out having manual interaction. Like, store the password in a variable and it should be supplied to the scp when it prompted for the password. Is there any other way than the user authentication and using "expect" in perl script. i.e is this... (3 Replies)
Discussion started by: pc_raghu
3 Replies

6. UNIX for Advanced & Expert Users

How to supply the password in a ping command ?

for i in $var; do for j in $var; do if then ssh -x -a "$host_login_name"@${i} ping -c 3 -s 3 ${j} if then printf "Success\n" else printf "Failed\n" fi fi done done Enter your box login... (2 Replies)
Discussion started by: happyrain
2 Replies

7. Red Hat

power supply status in sysreport

Hello guys: I'm a beginner in this exciting world of open spource and linux. I'm working as a support engineer and a customer send back to me a sysreport from his system running redhat 4. the customer has a power supply failed in his server and to see it and justify the replacement I required a... (0 Replies)
Discussion started by: amani
0 Replies

8. Shell Programming and Scripting

how to change root password using shell script with standard password

Hi Friends. I am new to scripting now i want to change the root password using the script with standard password. which is the easy scripting to learn for the beginner, Thanks in advance. (2 Replies)
Discussion started by: kurva
2 Replies

9. Shell Programming and Scripting

tcl command to supply a carriage return

I have a java program that runs on a unix server that prompts the user for input and provides a default value to the user. So it does something like this: Enter source server name <source_server_name>: Enter target server name <target_server_name>: I just hit enter to take the default... (1 Reply)
Discussion started by: progkcp
1 Replies
Login or Register to Ask a Question