Knowledge Base
Searching in : Article
ID: AR04J00628
Applies to: NoMachine Server
Added on: 2012-04-26
Last Update: 2017-01-13

How to configure NoMachine to contact the remote SSHD daemon on a port different from default 22

This article applies to NoMachine servers v. 4 or later supporting connections by the SSH protocol.


If you have configured the SSHD daemon on the server host  to use a port different from the default 22 you will need to configure the NoMachine server accordingly.

If you have installed a NoMachine server which supports web sessions, a further configuration will be necessary to allow connections from the web by SSH protocol on that port.

Configure the NoMachine server

Modify the server configuration file,  <InstallationPath>/NX/etc/server.cfg  by setting the proper value for the following configuration keys:

#
# Specify the TCP port where the SSHD daemon is listening on the NX
# Server host machine.
#
#SSHDPort 22

#
# Specify the TCP port where the SSHD daemon is running on the NX SSH
# authentication server.
#
#SSHDAuthPort 22

Please note that it's also possible to specify a remote SSHD daemon to be contacted by setting the following key:

#
# Specify hostname of the server used for NX SSH authentication.
#
#SSHDAuthServer 127.0.0.1

 

Make web sessions connect to an SSH port different from 22

Edit the NoMachine configuration file, i.e.:

a) for v. 6 or later:

the server configuration file (server.cfg)

b) for v. prior to 6:

the cloud configuration file (cloud.cfg)


Set the proper value for the new port in: Section "Server" and specify the login method to be used when connecting from the web via SSH. 

Specify 'system' to authorize with system password or 'nomachine' to authorize with the NoMachine server DSA key, for example:
 

Section "Server"

Name "Default connection"
Host localhost
Protocol system
Port 2222

EndSection
 

Note for Cloud Server v. 5.1.9 or earlier:

Section "Server" was previously called SectionSession, as well as other parameters have been renamed. The old format of this directive is:

SectionSession "Default connection"

ServerHost localhost
ConnectionMethod system
ConnectionPort 2222
ServerPath /etc/NX/nxserver

EndSection

 

Connect from the client with SSH protocol on a port different from the default

By default NoMachine client try to contact the SSHD daemon on the server host on port 22 on Linux and Mac and 4022 on Windows.

To connect to a different port, users need to launch the NoMachine GUI and edit their connection settings by selecting the SSH protocol and specify a proper value for the SSH port.