Find the answer to your Linux question:
Results 1 to 2 of 2
Hi Arrowheart (or anyone else!) I'm new to Linux (and this forum) and am trying to implemnent something that I am sure is really simple - but only if you ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    May 2011
    Posts
    14

    Using STDIN for telnet


    Hi Arrowheart (or anyone else!)
    I'm new to Linux (and this forum) and am trying to implemnent something that I am sure is really simple - but only if you know how!
    I am developing a Digi embedded module, writing in C on a linux OS and simply want to be able to read in and write out characters from the standard telnet port (23) when a client connects.

    Currently I have found some code that allows me to do this using port 3490 but if I change this to port 23 I just get an error that the address is already in use (I assume from STDIN).

    I have been told the easieast way to accomplish what I want is by using STDIN and STDOUT, but I have no idea where to start. It seems your snippit of code may be going in that direction.

    Any help greatly appreciated! Thanks.

  2. #2
    Linux Newbie
    Join Date
    Mar 2010
    Posts
    152
    Quote Originally Posted by dbriggs View Post
    Currently I have found some code that allows me to do this using port 3490 but if I change this to port 23 I just get an error that the address is already in use (I assume from STDIN).
    You probably have a telnet server already running - what happens when you try to telnet into the unit?

    If your Digi module is anything like the ones I work on, you probably have a line that looks something like this in /etc/inittab on your module:

    Code:
    # Start telnet daemon.
    ::sysinit:/bin/sh -l -c '/usr/sbin/telnetd -l /bin/login'
    Comment-out the line that starts ::sysinit:/bin/sh... and that'll stop the telnet server running at start-up time. Of course, this means you won't be able to telnet in, but I assume you're accessing a terminal through a serial console or some other method?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •