Saturday 15 March 2014

bash - Remote SSH commands not working in Linux -


Despite this, I am trying to write a script which will send me an order at different addresses. There is a shared key for the user, so there is no need to sign in. But it is not working.

Then, the following will not work ...

  #! // bin / bash ip = $ 1 shift args = "'$ @'" CMD = "$ user @ $ IP-C $ ARJX" output = $ ($ CMD)  

if i It executes with:

  ./ myscript.sh 10.0.1.2 / bin / ls -l / var  

I get an error " Ls -l / var: No such file or directory "

If I run that command (SSUH user @ 10.0.1.2-C '/ bin / LS-L / Veer), then It works fine.

What am I doing wrong? These are the same installation as RHEL 6.

Apparently, citations were confusing the dialect. The following tasks ...

  ip = $ 1 change $ (ssh -o connectimmeet = 1 user @ $ ip "$ @")  
< / Html>

No comments:

Post a Comment