1

I am writing a script that attaches to several of our machines via SSH to check some usage stats.

Each time I do:

ssh -i ~/.ssh/ourkeyfile.pem user@host

I get the typical message:

Address X.X.X.X maps to somedomain.com, but this does not map back to the address - POSSIBLE BREAK-IN ATTEMPT!

Is there a commandline switch for ssh that lets me suppress this message from appearing in the output of my script?

3 Answers 3

2

Well the script way is

2>&1 > /dev/null

The correct way is to fix ssh connection, host names.


Yeah, meaning need to fix known_hosts in .ssh folder.

2
  • oh right, of course, thanks. actually 2>/dev/null is what i want, because i don't want to suppress normal output. and also this is not a hosts problem. its a reverse ns lookup issue, not solvable from my end.
    – Octopus
    May 7, 2013 at 18:39
  • It is good to be a network and admin guy in the organization, as I do not have to wait for some network dude to update records for 2 weeks. May 7, 2013 at 18:45
0

Fix the reverse DNS entry (PTR record) and possibly the forward entry (A and AAAA records) for the host in question.

1
  • Thanks for the suggestion, but its not wise to do that on Amazon EC2 instances.
    – Octopus
    May 7, 2013 at 18:55
0

Based on what Danila suggested:

To suppress only the warnings and errors you would do this...

2>/dev/null

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .