How to execute a shell script that resides in another server?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to execute a shell script that resides in another server?
# 1  
Old 04-10-2014
How to execute a shell script that resides in another server?

hi,

i have a shellscipt that is in another server, my question is how do i run the script from a different server.

EXAMPLE:

SCRIPT_NAME: sample.sh
SERVER: A

what i wanted to achieve is to call that script from server B. Tried using ssh
Code:
ssh <username>@serverB /home/sample.sh

but it is asking me for a password.

Cheers,
# 2  
Old 04-10-2014
Passwordless entry using ssh: Link
# 3  
Old 04-10-2014
is there no other alternative?
# 4  
Old 04-10-2014
You could use expect to enter the password for you when ssh prompts for the password
# 5  
Old 04-10-2014
can you please show me how to do it?Smilie
# 6  
Old 04-11-2014
This User Gave Thanks to balajesuri For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to execute setDomainEnv.sh in wblogic via ssh on remote server in shell script?

How to execute setDomainEnv.sh in wblogic via ssh on remote server in shell script we execute setDomainEnv.sh manually as . ./setDomainEnv.sh from its location ie /opt/SP/users/domian/bin" My approach is not working. Please advise. #!/bin/bash set -x base="/opt/SP/users/d1/bin"... (5 Replies)
Discussion started by: abhaydas
5 Replies

2. Shell Programming and Scripting

Execute a shell script in UNIX server from Cygwin

Hi All, We have shell scripts in UNIX ( Sun OS ) server. Also in my windows machine i have Cygwin installed. Now is there a way to execute Shell script available in UNIX server from Cygwin? (4 Replies)
Discussion started by: Girish19
4 Replies

3. Shell Programming and Scripting

Batch script to execute shell script in UNIX server

Hi team, My requirement is to transfer pdf files from windows machine to unix server and then from that unix server we should sftp to another server. I have completed the first part i.e From windows to using to unix server with the help of psftp.exe code: psftp user@host -pw password <... (1 Reply)
Discussion started by: bhupeshchavan
1 Replies

4. Shell Programming and Scripting

How to Execute shell in more than one server?

Hi , I got a shell in one physical server and want to execute it in different servers. I did tried using ssh but iam not successful. Can someone through somelight on the subject and with some working examples ? Also iam trying PHP in the front end to execute the shell and show the logs in... (6 Replies)
Discussion started by: cskumar
6 Replies

5. Shell Programming and Scripting

Shell script to copy a file from one server to anther server and execute the binary

Hi , Is there any script to copy a files (weblogic bianary + silent.xml ) from one server (linux) to another servers and then execute the copy file. We want to copy a file on multiple servers and run the installation. Thanks (1 Reply)
Discussion started by: Nawrajesh
1 Replies

6. Shell Programming and Scripting

i want to execute shell script on remote server with in sftp session

Hi, I want to execute shell script with in sftp session for remote server. like i have a shell script test.sh that is on local server.i want to execute that script on remote server sftp user@192.168.56.10 sftp> test.sh ---execute for remote server not for local server. sftp... (3 Replies)
Discussion started by: SAUD PASHA
3 Replies

7. UNIX for Dummies Questions & Answers

ssh command to execute shell script in another server

ssh -q <hostname> /opt/tcs/satish/tst.ksh ssh -q <anotherserver> /opt/tcs/satish/tst.ksh tst.ksh has "nohup <command> & " when i execute below script , its throwing error as nohup can not be found ssh -q <anotherserver> /opt/tcs/satish/tst.ksh > log & can someone let me... (5 Replies)
Discussion started by: only4satish
5 Replies

8. Shell Programming and Scripting

how to execute shell script in another server that contain sql.

hi all, how to execute shell script in another server that contain sql script. i tried using "ssh -l" option.. but i am unable to load the environment variable of the remote host. please suggest how execute the shell script contain sql part inside it. (2 Replies)
Discussion started by: sandeep909
2 Replies

9. UNIX for Advanced & Expert Users

execute a script on test server from dev server

I need to execute a script from dev server which is located on Test server.I can use ftp to connect to dev server and from there how can i execute a command on test server. Thanks (5 Replies)
Discussion started by: ukatru
5 Replies

10. UNIX for Dummies Questions & Answers

What resides on my server(s)

I've got several AIX 5.3 LPARS that I'm administering, set up by 3rd party vendor before I got here. I've been asked by management to report on what's on each server; software, versions, patches available, etc. I know they're not identical: I've got different versions of ORACLE, APACHE, JAVA,... (0 Replies)
Discussion started by: keith.m
0 Replies
Login or Register to Ask a Question