Search code examples
linuxsshcentos6vnc-server

CentOS 6 VNC Server denies connection


I have set up tigervnc-server on my CentOS 6 machine following this guide. At first everything worked fine, I could connect to the server using TightVNC Viewer on my Windows machine. I left the session running in the background for a while. The server closed the inactive connection, which it also does for ssh or any other connections, so that's still normal. So I reconnected and everything was fine.

Then I decided to add a different user to the VNC users, as I was running my first connections from root. That's where it all broke. I couldn't connect to he server anymore, it always told me that the remote computer denied the connection. I made sure the server ports were open in iptables, tried to reinstall tigervnc-server, changing the config back to how it was before it broke and disabling the Windows Firewall. After reinstalling it, I was able to launch it without setting a vnc password, so it either saved it somehow from before or something broke entirely. None of my attempted fixes worked.


Solution

  • Turned out to be me not working on linux for over a year and I finally figured out I had to start the vnc server from the user I wanted it to run on.