Provide Password using to the application using the shell script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Provide Password using to the application using the shell script
# 1  
Old 11-04-2012
Provide Password using to the application using the shell script

Hello,

I have a requirement to shut down and start up my application on different environments (Dev, QA and Prod).

I have around 24 servers. I have to login to each server manually for shutinng down the application.

I wrote a shell command on each server and I am invoking those shell scripts from one server and shutting down.

Here is the issue now. I have problem in shutting down few servers using shell scripts because they need password before it shutdown.

I am executing the shell scripts with root access.

Is there any way that I can issue the password in the Shell itself so that the application will read the password from the shell script itself when it required?

I am new to this forum and LINUX as well. Need help to fix that instance so that my job will become easy

here is the shell script I am using to shut down my node

#!/bin/sh

############################# STOP NODES ###############################################
#stop the node node1
cd /opt/app/node1/bin/
./stopnode1.sh

#########################################################################################



Thanks in advance

Regards,
Raju
# 2  
Old 11-04-2012
You can setup ssh password-less login and remotely invoke your shutdown script like below:-

Code:
ssh $user@$host "/opt/app/node1/bin/stopnode1.sh"

I hope this helps.
# 3  
Old 11-05-2012
Hi,

Thank you for your reply.

I have to issue the password to bring down the application. If not the application will never come down. So, password is a mandate for me. This is not a system login password. I have to issue the password while the application is coming down which means this an application specific password.

Thanks in advance

Regards,
Raju
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Run an application in shell script

I run the following command using the command line. I need to run the same command in shell script : ./sas.server start start is a parameter that passes to start.server to startup services within start.server. the path to sas.server is /path/Lev1 Here is my code: #!/bin/sh set... (3 Replies)
Discussion started by: dellanicholson
3 Replies

2. Emergency UNIX and Linux Support

How to provide password for rsync in shell script?

Hi, i want to call the rsync in a shell script so that i can run it in background by passing the password within script itself. Can any one please let me know how can i provide the password in the shell script itself so that rsync will read the password when promted by the script. Its very... (11 Replies)
Discussion started by: Little
11 Replies

3. Shell Programming and Scripting

Can any one provide shell script for this ...

• With this script, users will be able to o Enter into the recycle bin mode. During this mode, all files deleted will be sent to the recycle bin. The recycle bin will be common to all users. o View contents of the recycle bin (his/her file(s) only). o Retrieve a particular file from the recycle... (3 Replies)
Discussion started by: bhavana busetty
3 Replies

4. Shell Programming and Scripting

Invoking Application in Shell Script

Hi All, I have a scenario : 1. A list of servers naming server21, server 22, server 23 etc. This list of servers is separate for my environments. Env1 has 3 server Env2 has 5 serves Env3 has 10 servers 2. Each server accesses application through which I want to invoke some method. So... (7 Replies)
Discussion started by: ankur328
7 Replies

5. Shell Programming and Scripting

How to provide password?

Hi , I am trying to unzip some file in a dir using shell script ,but it prompts for password to unzip those files ,how would i provide the passoword in the script it self (1 Reply)
Discussion started by: vikatakavi
1 Replies

6. Shell Programming and Scripting

How the user will provide the parameters for Oracle db connection in a shell script?

I'm new into unix. My question: is possible to write a shell script which will ask for the ORACLE_HOME, ORACLE_SID, USERNAME, PASSWORD to connect to Oracle db. In generally we have to set the ORACLE_HOME in .profile file. And after putting the 'sqlplus' command it asks for the username &... (6 Replies)
Discussion started by: priya001
6 Replies

7. Programming

How to provide password to the prompt through Java

Hi All, I am using Ubuntu machine with JDK 6. I am running following command on shell- sudo ./somecript . Now, it prompts for sudo password and I provide the sudo password on shell and "somescript" starts running with sudo permissions. What I want to do is, I need to execute... (1 Reply)
Discussion started by: jaibhim
1 Replies

8. Shell Programming and Scripting

Shell Script to provide "answers" to SSL Cert Request

Hello, I need assistance with creating a shell script to generate SSL Certificate Requests on remote hosts. Below is my stab at this, but I cannot figure out how to pass the requested arguments into the openssl command correctly. I have a major problem with redirecting the "answers" into the... (2 Replies)
Discussion started by: azvelocat
2 Replies

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

10. Shell Programming and Scripting

provide a user password from a script

Hi all, passwd <username> < /var/adm/passwd.txt cat /var/adm/passwd.txt abcd1234 abcd1234 when I run this from the script, it comes with: New password: It is not able to pick from the location /var/adm/passwd.txt. thanks in advance. (6 Replies)
Discussion started by: solaix14
6 Replies
Login or Register to Ask a Question