Sei sulla pagina 1di 6

Telnet and SSH

Example of setting up alternate ports for Telnet and SSH.

Option 1.
You would like to move GSW Telnet to an alternate port for everyone who connects.
1. Test the port you want to use to make sure it is not already in use. Open an
elevated Windows command prompt and enter the following specifying the
desired port. For my example we will use Port 2301.
netstat -a | findstr :2301
If the command returns nothing it usually means the port is available.
2. Add the port to the %systemroot%\system32\drivers\etc\services file.
. Right click on notepad.exe and select Run as Administrator.
. Using the File Menu select Open and paste %systemroot%\system32\drivers\etc

. At the bottom using the drop down select All.

3. Make sure the C:\Windows\System32\drivers\etc\services file does not have a file extension.
Enable viewing file extensions.
4. Configure services file with the desired GSW telnet ports.
#telnet 23/tcp
gstnet1 2301/tcp
gstnet2 2302/tcp
gstnet3 2303/tcp
gstnet4 2304/tcp

5. Stop and restart the gs_tnet service.


Open an elevated Windows command prompt and enter.
net stop gs_tnet
net start gs_tnet

6. Right click choose edit.


@gs_clnt.exe -h127.0.0.1 –uUser-Name –pPass_Word –d. -P2301
Where the –d. is , replace the dot with the domain name if the user is a domain user.

Save the changes and launch the GS Telnet Client shortcut to make a connection on port 2301.

7. From a Windows command prompt you can view the listening ports with this command.
netstat -aon |findstr :230*

Example:
C:\Windows\system32>netstat -aon |findstr :230*
TCP 0.0.0.0:2301 0.0.0.0:0 LISTENING 10700
TCP 0.0.0.0:2302 0.0.0.0:0 LISTENING 10700
TCP 0.0.0.0:2303 0.0.0.0:0 LISTENING 10700
TCP 0.0.0.0:2304 0.0.0.0:0 LISTENING 10700
TCP 127.0.0.1:2301 127.0.0.1:52998 ESTABLISHED 10700
TCP 127.0.0.1:2302 127.0.0.1:53008 ESTABLISHED 10700
TCP 127.0.0.1:2303 127.0.0.1:53043 ESTABLISHED 10700
TCP 127.0.0.1:2304 127.0.0.1:53055 ESTABLISHED 10700
8. Configure all devices to connect using the new port.

How to change the port that SSH connections use.

1. Open the Windows Registry to:


HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Georgia SoftWorks\GSW_SSHD\Parameters
Right click on usGSWSSHDPort and select Modify. Change the value in decimal.

For 32-bit Windows


HKEY_LOCAL_MACHINE\SOFTWARE\Georgia SoftWorks\GSW_SSHD\Parameters\usGSWSSHDPort
2. Following the same process as in the Telnet section 4 change the port value for SSH.
ssh 2222/tcp #SSH Remote Login Protocol

3. Stop and restart the gsw_sshd services.


net stop gsw_sshd
net start gsw_sshd

4. Configure SSH clients with the new port.


GSW Desktop client :
@gs_clnt.exe -h192.168.1.56 -uRfuser -pgsw$1955 -d. -P2223
Windows Mobile / CE clients.

Option 2:
Note Option 2 is not supported for the SSH protocol.

You would like for the User account that is connecting to run a profile based on the port
they are connecting with.

Example logon script C_Start.bat


set gwtn_term=1
set gwtn_graphics=1
set gwtn_color=1
set gwtn_server_port
set gwtn_reconnect=auto_by_user_and_ip
set gwtn_reconnect_timeout=45

@if %gwtn_server_port%==23 01 goto label 223


@if %gwtn_server_port%==2302 goto label2323

@:label23
@cd ..
@cd ..
@cd "C:\Program Files\SAP\FrontEnd\SAPgui\sapconsole"
@sapcnsl -pRFU02
@goto label23

@:label2323
@cd ..
@cd ..
@cd "C:\Program Files\SAP\FrontEnd\SAPgui\sapconsole"
@sapcnsl -p RFU01
@goto label2323

@labelend
Sapcnsl

Potrebbero piacerti anche