Search code examples
bashshelltelnet

Telnet - Connect and send message in one line


I'm looking for a one-line command that will connect to a telnet server (no authentication needed, it will accept any connection) and send text to the server after connection.

If this is not possible, is it possible to write a script that will do the same thing?


Solution

  • Sounds like you can use Netcat on the telnet port.

    An example would go like so:

    echo -n 'some string to telnet' | nc <server> 23