Вопрос

I am writing an application to run on a robot. Currently, it is headless, but I want to be able to telnet directly to the application with no authentication and access a shell that I will write.

Is this possible? Would it be practical or are there much easier solutions?

Это было полезно?

Решение

It is entirely possible.

However, if you are using Linux, you may just as well just let your application do it's I/O to the terminal, and use telnet to log in. If you set up a user to use your application as the "login-shell", it will allow direct access to that user called "robot" (for example) (and you can set it to have no password too) - then just do telnet -l robot machine port.

This would save you the effort of writing your own telnet client, and give you almost identical functionality.

Другие советы

If you're using a custom shell, why would you need telnet? Your shell can have a daemon component to listen on given port and then hand over the interaction to whatever REPL your shell would implement.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top