LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Execute script on remote linux server (https://www.linuxquestions.org/questions/linux-newbie-8/execute-script-on-remote-linux-server-852869/)

snorky 12-28-2010 01:37 PM

Execute script on remote linux server
 
Using linux machineX I want to execute a script on linux machineY. The script in question, scripts/thisscript.sh resides on machineY.
When I try
Code:

ssh me@machineY scripts/thisscript.sh
I never get far enough to start testing my script

I get this error:
Code:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!    @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
d0:56:4a:ea:7c:be:d5:64:04:74:e5:ff:xx:xx:xx:xx.
Please contact your system administrator.
Add correct host key in /home/me/.ssh/known_hosts to get rid of this message.
Offending key in /home/me/.ssh/known_hosts:2
RSA host key for 2xx.xxx.xx.xx has changed and you have requested strict checking.
Host key verification failed.

I tried contacting the system administrator, but since he is I, he's as ignorant as I am.

If the solution is - as stated above - to Add correct host key in /home/me/.ssh/known_hosts how do I find the correct key to add to the known_hosts file?

If not, what should I do?

FWIW, the server is an ancient Sun Cobalt RaQ 3 running Red Hat 7.2

stress_junkie 12-28-2010 01:40 PM

Ooops. Ignore this.

Tinkster 12-28-2010 04:37 PM

Quote:

Originally Posted by snorky (Post 4205722)
Using linux machineX I want to execute a script on linux machineY. The script in question, scripts/thisscript.sh resides on machineY.
When I try
Code:

ssh me@machineY scripts/thisscript.sh
I never get far enough to start testing my script

I get this error:
Code:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!    @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
d0:56:4a:ea:7c:be:d5:64:04:74:e5:ff:xx:xx:xx:xx.
Please contact your system administrator.
Add correct host key in /home/me/.ssh/known_hosts to get rid of this message.
Offending key in /home/me/.ssh/known_hosts:2
RSA host key for 2xx.xxx.xx.xx has changed and you have requested strict checking.
Host key verification failed.

I tried contacting the system administrator, but since he is I, he's as ignorant as I am.

If the solution is - as stated above - to Add correct host key in /home/me/.ssh/known_hosts how do I find the correct key to add to the known_hosts file?

If not, what should I do?

FWIW, the server is an ancient Sun Cobalt RaQ 3 running Red Hat 7.2

The answer is that you don't manually add anything. Delete the "bad" entry (if
you know for sure it's OK to do so, because e.g. you re-installed the machine
in question after machine X had first contacted machine Y.

So you simply edit /home/me/.ssh/known_hosts with your favourite editor, and
delete the offending line. Next time you connect ssh will ask you whether or
not you want to add the key to your know_hosts file, and voila, you're
away laughing (and sshing w/o error messages).



Cheers,
Tink


All times are GMT -5. The time now is 01:43 AM.