Script to bypass the password field


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script to bypass the password field
# 1  
Old 01-24-2012
Script to bypass the password field

Hello all
Im trying to write a script that can get past the "enter password" field.Coming to the details, Im planning to write a script that can actually check for the validity of certificates in websphere. There is a utility "keytool" that helps provide this information.However if we want to use it in a script everytime when we open a keyfile (say ex:kdb or jceks) it is going to ask for "enter password" which we can bypass by pressing "return/enter" key.Currently I'm struggling to get past this step.ANY Help is greatly appreciated.


[user@server bin]$ ./keytool -list -v -keystore /home1/server.jceks -storetype JCEKS
Enter keystore password: (this is where my script is stopping to take input,however i want to bypass this part which can be done by pressing enter/return key.Is there any way we can automate this one is my question.)

Keystore type: JCEKS
Keystore provider: IBMJCE


Valid from: 07/19/11 4:19 PM until: 07/19/16 4:19 PM



-----

Any help is appreciated guys..
# 2  
Old 01-24-2012
Read the manual page for "expect". It should do what you are asking for.
This User Gave Thanks to jgt For This Post:
# 3  
Old 01-26-2012
Thank you
# 4  
Old 01-26-2012
does this work for you?

Code:
./keytool -list -v -keystore /home1/server.jceks -storetype JCEKS<<EOF
password-here
EOF

This User Gave Thanks to frank_rizzo For This Post:
# 5  
Old 05-29-2012
That worked for me Frank_rizzo!

Spent at least 90 minutes looking around for help with the exact same problem.

My sample bit of perl code to test is below. The Return character after <<EOF is deliberate, and appears to be required:
Code:
!/usr/bin/perl
my $result = `keytool -list -v -keystore /usr/appserver/lib/install/templates/cacerts.jks <<EOF
EOF`;
print $result;


Last edited by Franklin52; 05-29-2012 at 10:31 AM.. Reason: Please use code tags
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Command/script to match a field and print the next field of each line in a file.

Hello, I have a text file in the below format: Source Destination State Lag Status CQA02W2K12pl:D:\CAQA ... (10 Replies)
Discussion started by: pocodot
10 Replies

2. Shell Programming and Scripting

SFTP prompting for password even though password is in script

Hi All, I am trying to transfer a file from one server to a remote server using SFTP. Client is not ready for key setup. I am working on Solaris 10. Here is the code. #!/bin/ksh # sample automatic Sftp script to dump a file USER="user1" PASSWORD="pass1" HOST="host1" sftp $USER@$HOST... (6 Replies)
Discussion started by: megha2525
6 Replies

3. Solaris

root password for system maintenance (control-d to bypass)

I have message "root password for system maintenance (control-d to bypass)" after Solaris 10 boots up. Why it appears ? thx for help. (3 Replies)
Discussion started by: presul
3 Replies

4. Shell Programming and Scripting

ftp:Password field is displayed

I am trying to get a file by doing ftp to the server. The below script works fine but as I type password it is displayed as simple text. HOST='192.108.245.101' echo 'username: ' read USER echo 'password:' read PASSWD ftp -n $HOST <<END_SCRIPT quote USER $USER quote PASS $PASSWD lcd... (1 Reply)
Discussion started by: hiten.r.chauhan
1 Replies

5. Solaris

can't bypass password authentication

I can able to SFTP from my web server unix to apps server unix end. but the other way from APPS server to Web server is still asking me the password. I have done same procedure both side. still i am having same problem. Any one help on this. thanks, regards (3 Replies)
Discussion started by: vijill
3 Replies

6. Solaris

bypass password authentication for sftp in unix

I am using solaris unix 8.2 version. I want to bypass password authentication for sftp. Can you please give some ideas on this. thanks.Regards. (4 Replies)
Discussion started by: vijill
4 Replies

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

8. Shell Programming and Scripting

How to bypass error in shell script?

Hi again, I have a script that moves files based on filelist: ------------------------------ filelist1=./rated.txt for file in $(< $filelist1) do mv ./$file ./Backup/$file done ------------------------------ If the file in filelist is not found from the folder the script fails.... (1 Reply)
Discussion started by: tmikahan
1 Replies

9. UNIX for Dummies Questions & Answers

Replace password field using ed/sed

I need to edit the password file to change the password field to *LK* for a specified account (abctest) like: abctest:*LK*:135:20::/home/abctest:/sbin/sh Can anyone help me do this using ed or sed? Thanks a lot! (6 Replies)
Discussion started by: munch
6 Replies

10. Shell Programming and Scripting

Is there a way to automatically prepopulate a password field?

I want to know if there is a way that I can right a script that will su to root and prepopulate the password field? (6 Replies)
Discussion started by: chrchcol
6 Replies
Login or Register to Ask a Question