Ssh – Writing a “telnet server” type program that uses SSH instead of telnet

encryptionSecuritysshtelnet

So people have written server programs using telnet in which the user simply does telnet server.com and this connects them to the server program, which then provides them with a textual program they can use over the net (like a MUD). There are some here, for example:

http://www.telnet.org/htm/places.htm

I wanted to write a server program like that, but I want it to have security against evesdropping and MITM attacks that SSH offers. So is it possible to write a program in which the user can do this on a linux machine ssh server.com or maybe this ssh guest@server.com and be patched into a similar text program as these telnet servers?

Best Answer

Create a user and set his login shell to your command.

For example:

sudo apt-get install sl
sudo adduser foo
sudo chsh -s $(which sl) foo
ssh foo@localhost

enter image description here

Also have a look at man sshd_config for some other ways to configure you ssh server. (Like adding a ForceCommand.)

Related Question