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
- 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.
- 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}”.’
- 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.
thanks- nice posting…clear instructions not always easy to find on the web.
One slight comment though: unless I’m mistaken ssh_config would only be edited if- in addition to changing the port that your ssh server listens on- you also want to change the port your ssh client will use in connecting to other servers. I suspect that would not be the intention of most people who would read this post.
Good point I’ll have to look into that a little closer and make the appropriate changes in the post. Thanks for letting me know!
thx alot mate, you made my day ! 🙂
This is exactly what I was looking for. For hours I tried connecting and I kept getting authentication errors and it was the same mistake you made. The SSHDAuthPort was commented out, so I didn’t even notice the setting. Uncommenting this, changing the port and restarting all services allowed me to connect perfectly.