You can choose not to show us your script and we can make lots of wild assumptions. Or, you could show us your complete script with proprietary information redacted. Instead you have shown us two other scripts. All I can do at this point is comment on the script you provided in post #3 in this thread (shown here with trailing spaces replaced by <space>:
Comments:
An asynchronous command in a shell script ends with the & that makes the preceding command asynchronous. Therefore, the here-document in this script does not provide input to the ssh command (ssh -t -t). Note that I left out $tar_host because nothing in this script sets it, you have given no indication that it is supplied a value and exported by the invoking shell, and you have stated that it no variables are passed into the script by defining them on the command line when you invoke the script.
Why did I mark the trailing spaces in your script? Although most of them do not matter, trailing spaces following the delimiter in a here-document prevent the shell from recognizing that line as a terminator for that here-document.
So, from #1 and #2 above, we have an ssh command with no host specified, no login specified, and no commands to be executed; and we have an unterminated here-document with no command defined to read the data in that here-document.
If what you are trying to do is to run ssh on host03 feeding it two commands in a here-document, you might want something more like:
This User Gave Thanks to Don Cragun For This Post:
mac 10.4>terminal>linux remote server>ssh login accepted>session closed-why?
AHHHH!!
I have been connecting to the server with the line: ssh userid@website.com
The remote server accepts my password; logs me in with ssh; posts a lovely welcome message AND closes the session. Is this a "term... (0 Replies)
Hi,
I have a script that runs for an hour.
Have to run it on remote server and need the output it produces on the remote server to decide for failure or success.
I run it through a Autosys Job which logs the outputs, both 1 & 2.
I use the commands
1) rsh <SERVER> 'nohup /tmp/xyz.ksh &'
2)... (5 Replies)
Hi Folks,
I want to create VNC session on the Remote RHEL machine on which ssh access is denied. Is there any way so that I can create VNC session without ssh access. Let me know all possible ways! (1 Reply)
I am running a useradd script, which works locally but I want to take some of that local information and send it to a remote system, ssh keys are set up between the two systems. I am attaching the script, look at the section titled
"Sending information to FTP2"
Removed attachment, added... (0 Replies)
I want to make a script to compare list of files in terms of its size on local & remote server whose names are same & this is required over ssh. How can I accomplish this.
Any help would be appreciated. (1 Reply)
Hi Guys,
So what I am trying to do is :
Host A should do a SSH to Host B to F. Login to the remote host and gather the output of uptime and write to to a file in HostA.
So by the end of the script, HostA should contain a file that contains the uptime output of Host B,C,D,E,F.
Right now... (1 Reply)
Is there a way that I can remotely control a user's ssh session so I can see what they are doing and walk them through the problem they are having on my AIX based application? (2 Replies)
Hello all,
i'm trying to create a report by greping a pattern on multiple remote hosts and creta a simple report,
actually i did this, is ther any better way to do this.
#!/bin/bash
for host in `cat RemoteHosts`
do
ssh $host -C 'hostname 2>&1; grep ERROR /var/log/WebServer.log.2019-09-21... (0 Replies)