Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers

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

share|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 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 at 6:24
add comment
ssh user@server telnet localhost 1234
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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