The program in general is I want to implement telnet program.On the client side user send its logging name and password, and if it is correct he starts to send commands to the serverOn the Server side I am check on the user authentication on the system and if it is true I must run his default shell which is stored in the passwd file, to execute his commands.The problem that when I tried to run his shell using the system C function the shell is run and then closed, because the system() use fork() and exec(), and after it finished the opened shell for the user is closed.How can I run a new shell in my process and keep it running for the following command execution?
telnet implementation using C
c;socket;telnet;system programming
You can't just use system.  You have to fork and exec yourself and use pipes in both directions.  You'd also have to use some kind of terminal interface if you wanted to catch Ctrl key input.