telnet through winsock socket

im trying to do telnet command in server through client pc. ive read about it and people says i only need socket for the whole job.from what ive understand about this reading is that a client socket will connect to the server where a socket is listening. after that, the command will be sent by the client socket and the server socket will receive it and perform the command. but if this is the whole flow then its useless to use socket, why not just directly do system("telnet command"); or a shellexecute? or im just understand it wrong? can someone explain me ? if i understand it whole wrong
Last edited on
ive read about it and people says i only need socket for the whole job
I'm not sure what you mean by this, or most of what you've said.

telnet is a program for users. You wouldn't write a program the uses telnet to control comms with a server because it's more compilcated than writing code to talk to the server yourself.
kbw so i just keep using socket communications? then make the server program execute commands?
You'd use the socket library within your program to communicate with an external server over TCP or UDP. Each server will have its own protocol to interact with it, so you have to observe it. For example: http://www.cplusplus.com/forum/unices/226435/
kbw hi

i just did a client-server socket. the client socket sits on different pc while server socket sits on the server. and thats the only way i can do to do the job and just like i said before the command sent by client socket is executed by the server socket application using shellexecute. but it took me 2 separate programs. its not really possible to have only client socket and connect to the server pc and make that pc execute my command? without having server application.
its not really possible to have only client and connect to the server pc and make that pc execute my command?
Yes.

SSH on Unix-like systems allows you to run "console commands" seamlessly, as most systems have the client and server installed by default. The same mechanism can be used on Windows.
https://support.suso.com/supki/SSH_Tutorial_for_Windows
https://arstechnica.com/information-technology/2015/06/microsoft-bringing-ssh-to-windows-and-powershell/
Last edited on
Registered users can post here. Sign in or register to post.