I need a program that would listen on a port, when someone connected, would prompt for a pass, then if the correct pass is given could run a bash script. This will be used on my Redhat or FreeBSD systems. Any help would be appreciated.
What kind of client are you going to expect users to use? If you want to allow the use of telnet or ssh type clients, and you want the user to see the output of the bash script, then the easiest solution for a Linux/FreeBSD box is to add a new user to the system, and make the bash script their default shell. If it's a custom client and server that is only going to fire off the script, then you can use the socket interface.
I know there is a way to do it, but I'm not sure how...
Sockets and servers are really easy to write in Java. JAVA is a better language for internet protcols and port listening.
As for running a second telnet deamon, howsa-bout turning on a SSH server as well, one with the script, one without. (you'd probably want to use SSH as your connection and turn telnet into the simple listener).
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.