I am connecting via ssh to a remote server, as follows:
The process works fine as I have the password to get into the server I need to work with.
I wanted to set a name to the IP address, as I would like to make the process smoother and avoid typing and remembering the server IP every single time.
I have edited the
/etc/hosts file adding the IP and linking to a new name, as follows (second row):
## # Host Database # # localhost is used to configure the loopback interface # when the system is booting. Do not change this entry. ## 127.0.0.1 localhost ::1 localhost 128.x.x.x newname
I have flushed the DNS cache with:
sudo killall -HUP mDNSResponder; sleep 2; echo macOS DNS Cache Reset | say
And yet, when calling the ssh server from the terminal via this command:
The command does not work and shows the following error message:
ssh: connect to host newname port 22: Operation timed out
Any suggestion is welcomed thanks!