I use linux for my cloud servers on Amazon-EC2 and openstack. When trying to run:
sudo chhown ubuntu somepath
I get this error from time to time:
sudo: cannot resolve the host
Most of the answers to this question on the Internet are to edit the / etc / hosts file.
However, I deploy my servers automatically. furthermore, I am not going to use "localhost", but rather my AWS public DNS:
ssh -i mykey.pem ubuntu@ec2-12-34-56-78.eu-central-1.compute.amazonaws.com
Therefore, I canβt just trivially insert localhost, not to mention that my IP address may change after I reset my machine. (Do not want to "waste" your precious floating IP addresses for each server)
In addition, I deploy dozens of servers at a time, so I cannot afford the manual step of editing a text file. Is there an automatic fix for this problem? I recently started using openstack, and the problem is there too.
ubuntu amazon-ec2 openstack sudo
eshalev
source share