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:


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?


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.)

| improve this answer | |
  • Ah yes, that's what I'm looking for. Follow up question - If i do this, I'm going to have a program that is accessed by many people simultaneously over the net, each running their own instance of the program. If have them all log in as the one user ( guest@server.com ), will they be able to evesdrop on other connections to guest@server.com using packet sniffers or other such tools? – user2948994 Feb 21 '14 at 2:20
  • No, they wont. Each user has his own TCP/SSH connection. The kernel will make sure that network packages for one connection are only send to the corresponding client. However you should write your configured server command very carefully. If your server allows users to open some kind of shell they have lots of possibilities. (But that is common to all kind of server applications.) – michas Feb 21 '14 at 6:24
ssh user@server telnet localhost 1234
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.