Monday, September 10, 2007

How To Change SSH Listening Port

Simple steps How To Change Ssh Port :

Login as root
From your terminal session, edit /etc/ssh/sshd_config

$vi /etc/ssh/sshd_config
######Look for the following line:
#Port 22

######Change the port to
Port 3210

#### Save sshd_config file with this command
:wq!

$

Restart SSH services with this command
$service sshd restart

Try to connect to your server with putty, but you need to change the ssh default port to 3210.

Change RDP / Terminal Services Default Listening Port

I Write this tutorial because sometimes i still forget how to change the terminal server default port.
Below are the steps how to change the terminal server port :

To change the default port for all new connections created on the Terminal Server:

1.
Run Regedt32 and go to this key:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-TcpNOTE: The above registry key is one path; it has been wrapped for readability.

2.
Find the "PortNumber" subkey and notice the value of 00000D3D, hex for (3389). Modify the port number in Hex and save the new value. To change the port for a specific connection on the Terminal Server:
•
Run Regedt32 and go to this key:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Terminal Server\WinStations\connectionNOTE: The above registry key is one path; it has been wrapped for readability.

3.
Find the "PortNumber" subkey and notice the value of 00000D3D, hex for (3389). Modify the port number in Hex and save the new value.
NOTE: Because the use of alternate ports has not been fully implemented for Terminal Server 4.0, support will be provided as "reasonable effort" only, and Microsoft may require you to set the port back to 3389, if any problems occur.