Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. socket program help

socket program help

Scheduled Pinned Locked Moved C / C++ / MFC
sysadminlinuxhelp
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mhetfield1978
    wrote on last edited by
    #1

    Hi all, I'm using C to write a socket program.I want to add in that server program that it will accept only the password from the client if it's "mypassword": i'm not writing any client program. the client will be the built in linux Telnet program so the session will be between the server and client as follows 1. telnet 192.11.11.9 password "mypassword". 2.then the server if recieved the password "mypassword" it will connect if not it will close the connection. I want to know how i can make the server program recognize that the pasword is right or wrong..how i can write it in the server Thanks

    M M 2 Replies Last reply
    0
    • M mhetfield1978

      Hi all, I'm using C to write a socket program.I want to add in that server program that it will accept only the password from the client if it's "mypassword": i'm not writing any client program. the client will be the built in linux Telnet program so the session will be between the server and client as follows 1. telnet 192.11.11.9 password "mypassword". 2.then the server if recieved the password "mypassword" it will connect if not it will close the connection. I want to know how i can make the server program recognize that the pasword is right or wrong..how i can write it in the server Thanks

      M Offline
      M Offline
      Mila025
      wrote on last edited by
      #2

      Hi, Telnet clients doesn't connect just like that - for telnet connection is special protocol - helping documents: Telnet protocol: RFC 318 Telnet protocol specification: RFC 854 Telnet options specifications: RFC 855.

      ----------- Mila

      1 Reply Last reply
      0
      • M mhetfield1978

        Hi all, I'm using C to write a socket program.I want to add in that server program that it will accept only the password from the client if it's "mypassword": i'm not writing any client program. the client will be the built in linux Telnet program so the session will be between the server and client as follows 1. telnet 192.11.11.9 password "mypassword". 2.then the server if recieved the password "mypassword" it will connect if not it will close the connection. I want to know how i can make the server program recognize that the pasword is right or wrong..how i can write it in the server Thanks

        M Offline
        M Offline
        Moak
        wrote on last edited by
        #3

        You could write an interactive login sequence. For example your server sends the text line "Enter your authorisation" immediately when a client connects, then evaluate the first newline terminated response from the client. However, this simple approach works with most telnet clients only on a non standard port (other than port TCP 23)... I would strongly recommend to implement the full telnet protocol or at least look for IAC sequences in the server code (RFC 854). Hope this helps.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups