I recently pulled my hair out for a couple of hours on a problem that was really simple…I just was overlooking a setting. To help other people save time on this exercise I wanted to share my experience.

I have OpenSuSE 11.1 virtual machine. I installed the NXServer on that machine so that I could control it from my Mac laptop and Windows 7 Desktop. I needed to change the ports to allow me to communicate from outside of my home. In order to do this, I knew that I needed to change my SSH port as well as my NX Server port.

Here is what you have to do:

  • Edit your sshd_config file
    Edit the /etc/ssh/sshd_config file changing the line that says “Port 22” to “Port {your_number}”
  • Edit your ssh_config file (Please note, you’ll only want to do this step if you are controlling the port your client on this machine will always look for in a connection) –
    Edit the /etc/ssh/ssh_config file by changing the line that says “Port 22” to “Port {your_number}”
  • Edit your server.cfg file
    1. Edit the /usr/NX/etc/server.cfg file by changing TWO lines. This is where I messed up and had a hard time figuring out my problem.
    2. The first line you need to edit is: ‘#SSHDPort = “22”.’ You need to change that to (first, remove the # sign to make it active instead of being a comment): ‘SSHDPort = “{your_number}”.’
    3. The second line you need to edit is: ‘#SSHDAuthPort = “22”.’ You need to change that to (first, remove the # sign to make it active instead of being a comment): ‘SSHDAuthPort = “{your_number}”.’ If you don’t change this line, your NX Client will give a error saying: “Authentication failed for user {username}”.
  • Edit your node.cfg file
    Next, edit your /usr/NX/etc/node.cfg file by changing one line: ‘#SSHDPort = “22”.’ You need to change that to (first, remove the # sign to make it active instead of being a comment): ‘SSHDPort = “{your_number}”.’

  • Restart your Services
    Restart SSH by issuing the following Command: “/etc/init.d/sshd restart”
    Restart the NX Server by issuing the following Command: “/etc/init.d/nxserver restart”

There you have it. You should be able to connect via a non-standard, non-default port with the nxclient.