ksh script with Interactive ssh on remote server


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting ksh script with Interactive ssh on remote server
# 8  
Old 09-27-2011
Quote:
Originally Posted by Jeevanm
Hi All Gurus,

I am still unable to solve this problem and expert advise will really help.

Thanks.
try this
Code:
ssh -o IdentityFile=/root/.ssh/id_dsa root@${ip} 'ksh /remote_script/server_install_soft.ksh;rm /tmp/log/old_log.log'

# 9  
Old 09-27-2011
Network

Nope, this I have tried but it does not work,

I have to execute the script /remote_script/server_install_soft.ksh Smilieon remote server from my current shell. As explained in detail in the beginning of the thread.

Thanks
# 10  
Old 09-27-2011
what is the output after this?
Code:
# ksh -x yourscript

# 11  
Old 01-25-2012
Hi ygemici

Dear friend,ygemici
Could you please explain why you need "-x" (execution output) here?
The question is how to execute an interactive script from server A on server B.
As far as I know The "-x" is irrelevant here. Request you to go through the question once again and correct me if I am wrong.

The question is still open for all and not yet resolved.

The alternate I am using is to send feedback why ssh from server B to server A and execute scripts there, unfortunately its very vary complex SmilieSmilie
# 12  
Old 01-25-2012
Quote:
Originally Posted by Jeevanm
Dear friend,ygemici
Could you please explain why you need "-x" (execution output) here?
The question is how to execute an interactive script from server A on server B.
As far as I know The "-x" is irrelevant here. Request you to go through the question once again and correct me if I am wrong.

The question is still open for all and not yet resolved.

The alternate I am using is to send feedback why ssh from server B to server A and execute scripts there, unfortunately its very vary complex SmilieSmilie
I'm trying to figure out the cause of the hangup.
debugging,everytime gives an idea.
now can you write the contents of script?
Code:
# cat server_install_soft.ksh

# 13  
Old 01-25-2012
Post #7 is about as near as you are going to get. It provides typeahead to the interactive program. This usually works better with the "-n" switch to the remote Shell program. The remote shell approach is best done with a custom script on the remote computer.

If you want to work interactively with a remote computer you need to login properly, do your typing, and then logout. There may workarounds for repetitive tasks but don't bet on it.

I'm not still clear what you are actually trying to do. All we have to work on is a solution which does not work. We need to see the problem.
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 have local shell variables in a ksh script seen on remove server in SSH block?

I have googled this and found many solutions, but none of them are working for me. I am in a korn shell, most others reference bsh, maybe that is the issue? Anyway, all I am trying to do is use a variable I have declared in my main script in a remote shell I am running through ssh. So I have a... (8 Replies)
Discussion started by: DJR
8 Replies

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

3. Shell Programming and Scripting

Script connect to remote server, not find files and exit only from remote server, but not from scrip

I have a script, which connecting to remote server and first checks, if the files are there by timestamp. If not I want the script exit without error. Below is a code TARFILE=${NAME}.tar TARGZFILE=${NAME}.tar.gz ssh ${DESTSERVNAME} 'cd /export/home/iciprod/download/let/monthly;... (3 Replies)
Discussion started by: digioleg54
3 Replies

4. Ubuntu

Run a script at remote server without ssh password

Hello, What I want to do is to run a file on remote server by running a script at localhost but script should not ask ssh password of my remote server when script is executed. Scenario1: To copy files from server2 to data server:$ scp -r root@server2_ip:/var/www/html/*.* /var/ When I enter... (6 Replies)
Discussion started by: baris35
6 Replies

5. UNIX for Dummies Questions & Answers

Executing ksh script to remote server want output on same window

I'm having a brain freeze moment. I've created a ksh script in AIX that ssh's to a remote server, executes some commands, and then logs out. All of this is sent to a file. I then have the script cat the file so i can see the output. Even though the cat command is outside of the remote session part;... (5 Replies)
Discussion started by: seekryts15
5 Replies

6. Shell Programming and Scripting

Script to ssh to remote server

Hi All, I need to prepare a script. Description: Currently i am in server "x(ubuntu os)", here i need to develop a script to ssh to another server "y(ubuntu os)", i have password less authentication to "y". i have done the below #!/bin/bash #ssh to the server "y" and confirming i am... (2 Replies)
Discussion started by: kumar85shiv
2 Replies

7. Shell Programming and Scripting

manage an interactive script on a remote host

OS~AIX 6.1 I'm running an interactive shell script i.e.,waits for a user response a few times while executing, after doing ssh to a AIX server. I'm just wondering what options I have if the ssh connection to the server is lost while executing the script, do I have to run the script again, which in... (2 Replies)
Discussion started by: mbak
2 Replies

8. Shell Programming and Scripting

Running a function on a remote server via SSH in a script

I'm working on a script (mostly for practice) to simplify a task I have to do every now and then. I have a cluster with 6 servers on it, each server has a directory with a set of files called *.pid and *.mpid. Each file contains the pid of a process that may or may not be running on that server.... (3 Replies)
Discussion started by: DeCoTwc
3 Replies

9. Shell Programming and Scripting

shell script for how to connect to a remote server by using ssh

i want to connect to a remote server through ssh. i have to also provide password within that script. after connecting to the remote server i want to do some operations like grep,cd etc can u pls help me to wite a script. Thanks (1 Reply)
Discussion started by: millan
1 Replies

10. Shell Programming and Scripting

automatic ssh into remote server using ksh

I still have to enter the password when I want to auto login w/o having to do any command line entry. This code works but I don't want to have to enter the password at the command line. After manning ssh I still am not sure what settings I need to change. Please help. Thanks! <<<output>>>... (4 Replies)
Discussion started by: tekline
4 Replies
Login or Register to Ask a Question