Sorry for not being clear on my initial post. Below are the details:
jar=test.jar
md5=test.jar.md5
now i want to do the below:
#1. md5sum test.jar (exists in remote server x)
#2. cat test.jar.md5 (exists in remote server x)
#3. Now from my local machine i want to ssh to the remote server x and then want to check whether md5sum is matching
I tried the below:
==================
========================
output:
-----------
-- when i cat the file its displaying the result without any issue
-- but when i do the same inside the if condition its throwing permission error
Note: On the remote server I have all the required permissions to read and execute these jar and md5 files.
I tried alot of time on this but couldn't able to find the issue. Could someone help me here.
Thanks
Moderator's Comments:
Please use next time code tags for your cade and data, thanks
Hello Everybody,
I'm facing a weird problem with the awk command.
I'm trying to execute a simple awk command as follows,
echo 1 2 | awk '{print $2}'
This command prints the output 2.
When i try to execute the same command in a remote server using ssh as follows,
ssh user@host... (2 Replies)
I have a script that connects to remote servers using a public key. Some of the servers are not set up for the public key and I receive the following when I attempt to ssh: The authenticity of host 'XXX' can't be established.
RSA key fingerprint is... (1 Reply)
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)
the ssh calling convention:
ssh <server>
If I put commands in the section, ssh will execute them immediately after logging in and return to local shell. I want to stay in the remote shell after executing these commands. How can I achieve this?
Thanks for all. (1 Reply)
Hello again :) ,
My script has an ssh command to run a script on a remote machine. The script has commands such as sqlplus and unzip. However, the return I get in my own terminal says it can't find sqlplus and unzip.
the ssh command is:
ssh user@host "cd ScriptDir; ./Script.sh"
and the... (6 Replies)
Hi All,
i have two machines like x and y . my requirement is i should connect to machine Y from x through ssh connection . and do some operation such as copy and move and delete files in Y machine .
i tried with this code but it is doing in machine x only . and i need to exit from Y when... (1 Reply)
I have some commands which need to be executed in remote machine.
I have Linux Server from where I need to connect to Solaris server using ssh and then declare some variable over there and run some commands. I don't want to call a script which is present in Solaris server from Linux server... (7 Replies)
Hi,
I'm tryin to write a script that will collect information about a remote servers, put them into variables and print them to screen.
# /usr/bin/bash
ls $1 > /dev/null 2>/dev/null
if
then
echo "$1 is file"
for server in $(cat $1)
do
# echo $server
... (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)
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)
Discussion started by: oraclermanpt
3 Replies
LEARN ABOUT REDHAT
recon
RECON(1) LAM TOOLS RECON(1)NAME
recon - Check if LAM can be started.
SYNTAX
recon [-abdhv] [<bhost>]
OPTIONS -a Report all host errors.
-b Assume local and remote shell are the same. This means that only one remote shell invocation is used to each node. If -b is not
used, two remote shell invocations are used to each node.
-d Turn on debugging.
-h Print the command help menu.
-v Be verbose.
DESCRIPTION
In order for LAM to be started on a remote UNIX machine, several requirements have to be fulfilled:
1) The machine must be reachable via the network.
2) The user must be able to remotely execute on the machine with the default remote shell program that was chosen when LAM was config-
ured. This is usually rsh(1), but any remote shell program is acceptable (such as ssh(1), etc.). Note that remote host permission
must be configured such that the remote shell program will not ask for a password when a command is invoked on remote host.
3) The remote user's shell must have a search path that will locate LAM executables.
4) The remote shell's startup file must not print anything to standard error when invoked non-interactively.
If any of these requirements is not met for any machine declared in <bhost>, LAM will not be able to start. By running recon first, the
user will be able to quickly identify and correct problems in the setup that would inhibit LAM from starting.
The local machine where recon is invoked must be one of the machines specified in <bhost>.
The <bhost> file is a LAM boot schema written in the host file syntax. See bhost(5). Instead of the command line, a boot schema can be
specified in the LAMBHOST environment variable. Otherwise a default file, bhost.def, is used. LAM seaches for <bhost> first in the local
directory and then in the installation directory under etc/.
recon tests each machine defined in <bhost> by attempting to execute on it the tkill(1) command using its "pretend" option (no action is
taken). This test, if successful, indicates that all the requirements listed above are met, and thus LAM can be started on the machine.
If the attempt is successful, the next machine is checked. In case the attempt fails, a descriptive error message is displayed and recon
stops unless the -a option is used, in which case recon continues checking the remaining machines.
If recon takes a long time to finish successfully, this will be a good indication to the user that the LAM system to be started has slow
communication links or heavily loaded machines, and it might be preferable to exclude or replace some of the machines in the system.
Remote shell invocation
Note that the default remote shell command can be overriden at invocation time with the LAMRSH environment variable. The LAMRSH environ-
ment variable can be set with a new command and optional command line arguments. For example, the 1.x series of ssh clients require the -x
flag to be specified to suppress standard ssh information from being sent to the standard error (which would cause recon to fail). For
example (for the C shell and its derrivates):
setenv LAMRSH "ssh -x"
Normally, recon uses two remote shell invocations to each node. The first remote shell invocation is used to determine the user's shell on
the remote node. The second remote shell invocation is used to launch the desired LAM binary on the remote node. If the -b switch is
used, recon will assume that the user's shell on all remote nodes is the same as it is on the local node, and therefore only one remote
shell invocation is used, which is noticably faster.
In either case, on remote nodes, if the user's shell is not csh, tcsh, or bash, .profile is invoked by LAM before invoking any LAM binary.
This allows the user to setup paths and any necessary environment before LAM binaries are invoked (csh and tcsh users can put such setup in
their $HOME/.cshrc or $HOME/.tcshrc files; bash users can put this setup in their $HOME/.bashrc file).
FILES
$LAMHOME/etc/lam-bhost.def default boot schema file
EXAMPLES
recon -v mynodes
Check if LAM can be started on all the UNIX machines described in the boot schema mynodes. Report about important steps as they are
done.
recon -v -a
Check if LAM can be started on all the UNIX machines described in the default boot schema. Report about important steps as they are
done. Check all the machines; do not stop after the first error message.
SEE ALSO rsh(1), tkill(1), bhost(5), lamboot(1), wipe(1), lam-helpfile(5)LAM 6.5.8 November, 2002 RECON(1)