0

I have three machines, let's say 10.49.1.101, 10.49.1.102, 10.49.1.103. These IP's are also present each other in /etc/hosts file. If I simply do ssh between these machines it works completely fine. But If I try to remove folder using ssh something like this from 10.49.1.101

for rs in `cat "ip-s"`; do echo $rs; ssh $rs "rm -rf path/to/dir"; done
// ip-s contains all the 3 server ips

will throw a below error and it won't succeed. But it works from 10.49.4.102, 10.49.4.103

: Name or service not knownname 10.49.1.102
: Name or service not knownname 10.49.1.103

FYI, These are the redhat versions

  • 10.49.1.101 - Redhat 7.7
  • 10.49.1.102 - Redhat 6.6
  • 10.49.1.103 - Redhat 6.6

Is it a redhat-7.7 version problem. If yes, how to fix this issue?

4
  • Well, there shouldn't be such a problem, is there a spelling error, when running directly from the command line there are similar errors reported? You used IP to SSH, but the prompt seems to be related to DNS Commented Oct 25, 2022 at 14:27
  • If I try SSH hostname, It works again. I verified the spelling in /etc/hosts. No mistakes found Commented Oct 25, 2022 at 14:44
  • @山河以无恙 did I answered your question? Commented Oct 25, 2022 at 15:49
  • Yes, I know what you mean. It's a strange thing. In fact, it won't happen Commented Oct 25, 2022 at 16:01

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.