How to Change the Port on NX Server

NX Server is a commercial application released by the company NoMachine. It allows you to connect to your Linux server similar to how you would connect to a Windows computer using remote desktop. NoMachine offers a free version of the product which has a restriction of only allowing 2 simultaneous connections to the server. NX Server runs over SSH so you don’t need to open any other ports on your firewall other than the port for the SSH service.

It is considered a good security practice to change the default port the SSH service listens on. When you change this port it breaks the NX Server service since it expects the SSH service to be running on the default port of 22. You can fix NX Server by modyfing the following file:


Set the following settings in the file:

SSHDPort = "22"
SSHDAuthPort = "22"

Change “22” to whatever port your SSH service is now listening on. You’ll then need to restart the NX Server service to put the changes into effect:

/etc/init.d/nxserver restart

NOTE: The instructions above were tested on a Linux Red Hat 5 server.

2 thoughts on “How to Change the Port on NX Server”

  1. Yes! This was exactly the information I was looking for. My ISP decided to block port 22 and told me to change the port. Of course, I was cluless until I found your article.

    Thank you for the short, concise information! Much appreciated.

  2. That was a great help! After googeling almost five hours and reading scilly advises I found your very precise small “How to” Tis is great and I wish that all of the advisors could have the great skill that you have!

    Much appreciated.

Leave a Reply

Your email address will not be published. Required fields are marked *