The secure and correct way to communicate with non-public services on a virtual server machine is via ssh
tunnel
(services like managment console or a database).
To create a simple ssh
tunnel from your host machine to the server on the same port number:
ssh -L 9090:localhost:9090 [email protected]
However, you probably don't want to type this every time or remember the port numbers of each of your machines.
In that case edit your local ssh
config file ~/.ssh/config
and add the following below other settings:
Host monitor.vps1
HostName kewldomain.com
User god
LocalForward 9090 localhost:9090
Now you can just type ssh monitor.vps1
and it will connect the machine and open
a secure tunnel to the service on port 9090
(no need to update the hostfile).