Greetings, i've been working with a user-friendly menu on ksh to allow users execute scripts located on a remote server, so they wont have to login and manually launch those scripts every single time.
This is a HP-UX box and currently on a /usr/bin/ksh shell.
I've setup ssh keys on both servers, so i'm able to execute commands remotely using ssh (ej, ssh vic@targetserver ls -l). My script basically gathers several variables from user input, then assambles the whole command and tries to execute it with ssh to the other server.
What i'm currently unable to do, is to finally get that command executed AND give the prompt back to the user so he can continue using the menu (even when using & and nohup).
OR
I've managed to get two results: Either the command does not gets executed, or it does but will not give prompt back.
If i try to manually run the full command, it will work nicelly:
I'm quite sure this is a syntax/variable issue, but i've been breaking my head for two days and i'm out of ideas. My apologies in advance if more information is needed to understand the issue, i'm not used to post messages here.
Hi,
I am trying to complete my bash script in order to find which SSH servers on LAN are still active with the ssh keys, but i am frozen at this step:
#!/bin/bash
# LAN SSH KEYS DISCOVERY SCRIPT
</etc/passwd \
grep /bin/bash |
cut -d: -f6 |
sudo xargs -i -- sh -c '
&& cat... (11 Replies)
I have worked on multiple scenarios to execute remote script via ssh.
This problem I am not able to resolve.
2 linux hosts. Server1, Server2
on Server1 I have script called ~/scripts/start_standalone.sh
XXXX
cd $JBOSS_HOME
NODENAME=xyz; IP_ADDR=`hostname`; MGMT_IPADDR=`hostname`;... (3 Replies)
Dear All,
I have a requirement where I have to SFTP or SCP a file in a batch script. Unfortunately, the destination server setup is such that it doesn't allow for shell command line login. So, I am not able to set up SSH keys. My source server is having issues with Expect. So, unable to use... (5 Replies)
How to execute a script in remote machine through ssh
I have a script test.sh which does some backup activity in remote machine. Wanted to keep backup also in remote machine.
ssh -l username <remote machine> "commands to be exceuted as ; separted"
but how to put the script in the place of... (5 Replies)
ok, I'm new to the forum and I did a few searches and didn't find much on this so here goes.
I have a ksh I use to call an expect script that opens a ssh session and then extracts a tar file. The tar file has my prefered .profile and my ssh keys. I want to run this script 1 time on new servers and... (2 Replies)
Hi All,
I have an issue where in when i execute a script in the background using '&', it exits with stopped(SIGTTOU) signal.
There are two servers, where the Compute server is HP-Unix and Data server is Linux.
I tried using the "stty - tostop" command to disable the SIGTTOU for background... (1 Reply)
Help please!!
I want to use ssh to execute a remote exe and while it's running I want to query for the process ID of the exe (2 different ssh commands)
1. sshpass -p "<passwd>" ssh -f -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@<ipaddress> nohup /tmp/mmds_asyn &
2.... (0 Replies)
Hi i m writing a script which will fetch data from different machines and display it on single terminal.
I have created a file named SERVERNAMES containing ip address of machines i need to monitor.
Then for every IP i m issuing ssh command to get date on that machine.
However When i m trying... (3 Replies)
Hello all,
I have a relatively simple script I wrote to generate a count of errors broken down. What I would like to do is execute this script from another server so that I don't actually have to log in to the server to run the check.
The script on what we'll call "Server A" is:
... (2 Replies)
I'm writing a script which is meant to ssh into a remote machine, sed a file there, and write the output to a new file on the remote machine. Obviously the easy way to do this is to write and execute the script on the remote machine, but I'm trying to do this all via ssh since I like to keep and... (4 Replies)