LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-28-2010, 01:37 PM   #1
snorky
LQ Newbie
 
Registered: Aug 2003
Location: upper left corner, US of A
Distribution: several
Posts: 15

Rep: Reputation: 1
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

Last edited by snorky; 12-28-2010 at 02:11 PM. Reason: clarify more
 
Old 12-28-2010, 01:40 PM   #2
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
Ooops. Ignore this.

Last edited by stress_junkie; 12-28-2010 at 01:41 PM.
 
Old 12-28-2010, 04:37 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally Posted by snorky View Post
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
 
  


Reply

Tags
execute, key, remote, rsa


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Execute script on local server as normal user to run commands on remote server ALInux Linux - Software 1 01-01-2010 06:30 AM
How to execute a ssh script on Linux server from Windows through a bat script? wanna13e Programming 13 10-23-2009 02:41 AM
"URGENT"How can i execute shell script from a remote server ? amit.giri Linux - Newbie 9 10-05-2009 09:15 AM
Execute script from central server without uploading to remote machines zugly Linux - Newbie 7 03-18-2009 11:39 AM
Remote Win Bat File execute Shell Script on AIX Server DriveMeCrazy AIX 5 05-26-2004 06:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration