No connection could be made because the target machine actively refused it.

February 18, 2018 1.4k views
Networking Debian
144429
By:
144429

When I try to connect to my vncserver it gives me the Error:

Error in TightVNC Viewer: No connection could be made because the target machine actively refused it.

I initially solved this by adding ::5901 to the end of my ip address.. After being unable to open the browser trouble i "rebooted" server and since then I have not able to connect to the vnc server.

I can see the server is running when i type vncserver -list and have tried killing that server and starting a new one. How do I know what port my server is running on or how can I change it?

1 Answer

To find out what port it's listening on, and just as importantly which network interface, run:

sudo netstat -plutn

If it's running on 127.0.0.1 or ::1, it won't be accessible outside of the Droplet.

Have another answer? Share your knowledge.