Make a Telnet server
From TinkernutWiki
| Make a Telnet server | |
| A tutorial by: | Computerguy |
| Description: | Learn how to make your own Telnet server! |
This will show you how to make a Telnet server.
Contents |
Get the Files
We will be using the KpyM Telnet SSH server software for this. You can get it from kpym.com.
Install It
Run the installer and choose for it to be a Telnet server.(It is set to be an SSH server by default)
Test It
Now to configure it. We will be using a Telnet client so download the PuTTy Telnet/SSH client here. Then run it and choose for a Telnet session. Type in "localhost" and click connect. A console window will appear with a message about a full version, just do as it tells you. Then for the username and password.
What is the user and pass?
The username and password are going to be the credentials for the account it is running under. So if you logged into your computer with Username:bob and Password:ILoveKittyCats then that will be the user/pass for the telnet server.
Now you should see something like the following:
================================================================ .\scripts\allusers.bat this script is executed for all users delete/rename it if you dont need it ================================================================ Active code page: 437 C:\Users\user>
This means that the server is working!
Configure It
Now, to make it do what we want it to do! To do this we will need to change some things. But first, get a batch file or console program that you want the server to host. Now, go to C:\Program Files\KTS\scripts and put it there. Then open up the start menu and go to the KTS folder. Open Setup KpyM Telnet SSH Server. Then arrow down to [KSession] : shell_command and hit enter. It will bring up a page like this:
[KSession] : shell_command = %COMSPEC% /K "scripts\allusers.bat"
Edit it like this to run your batch file:
[KSession] : shell_command = %COMSPEC% /K "scripts\program_name_here.bat"
Now hit enter again to save it. Reconnect to the server with PuTTy and you will see that it ran your batch file.
Make a Public Server
Want anyone to use your server without entering that annoying password? Well you can! Open up the Setup KpyM Telnet SSH Server program and arrow down to [KSession]: default_user and [KSession]: default_pass. Change both of these to your user/pass.
Make a Secure Public Server
The server is going to have the privileges that the account it's running on has, so a good idea is to create a standard user account just for the Telnet server so that no hackers can get very far should the telnet server allow them access to a command prompt,etc.
Allow access to It
To let people access the server you are going to have to open port 23 on your firewall and port forward it on your router.
Glitched Server?
Did you just close out of your PuTTy window? It will keep the session logged in after you close the window and when you reconnect you will have a command prompt instead of your batch file. To fix this open up the Telnet server management program and change allow_disconnected_sessions and auto_reconnect_session. Do this by changing it from 1 to 0.
Rem Text Showing
The telnet server interprets "rem" as "echo". Sorry avid "rem" command users!
Cannot Call File
Unlike when a batch file runs locally, the server changes it's directory to the user account's directory. To call another program in the /scripts directory do this each time:
cd C:\Program Files\KTS\scripts call program_name.bat