telnet login!

hello all
i have modified the telnetclient exmple to connect to port 23
the connection succeeded but the reply wasnt what i expected

when i telnet on pc, i get this reply:

MikroTik v6.36.3 (stable)
Login:

here i enter my user name (admin) and no password

but on the arduino, using this code

  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }

  // start the Ethernet connection:
  if (Ethernet.begin(mac) == 0) {
    Serial.println("Failed to configure Ethernet using DHCP");
    // try to congifure using IP address instead of DHCP:
    Ethernet.begin(mac, ip);
  }
  // give the Ethernet shield a second to initialize:
  delay(1000);
  Serial.println("connecting...");

  // if you get a connection, report back via serial:
  if (client.connect(server, 23)) {
    Serial.println("connected");
    delay(1000);
      if (client.available()) {
     while (client.available()) {
    char c = client.read();
    Serial.print(c);}
  }
 
    // Make a HTTP request:
    client.write("admin/n");
client.pritnln("");

i get this result in the serial monitor

connecting...
connected
ے‎ے‎ ے‎#ے‎'

i tried all the baud rates and non made sense

i think this it the login page, i tried sending "admin" but i got no reply
i sent "admin" in a loop, i know it is wrong but i was waiting for the router to tell me that login is incorrect but still no reply, no matter what i send using println() or write() got no reply

any idea what i should do?

thanks

Telnet Authentication Option

Juraj:
Telnet Authentication Option

thank you Mr. juraj for keep helping me

i read it and tryed to send "IAC WILL AUTHENTICATION" using println()
the document says that i should get "IAC DO vAUTHENTICATION" as reply from the router, but i didnt get anythnig

i dont understand why only telnet on arduino is different than cmd,
on cmd and arduino i got the same reply on ports 22, 80 and 8728 but on the telnet port the reply on arduino is different

it is not different, only the authentication part handles the Telnet client program on computer.

I did a little googling and found some C source code for telnet authentication but it is complex in general if it needs handle all the possibilities.

In your case, the client must first send that it will authenticate.

Juraj:
it is not different, only the authentication part handles the Telnet client program on computer.

I did a little googling and found some C source code for telnet authentication but it is complex in general if it needs handle all the possibilities.

In your case, the client must first send that it will authenticate.

i did, as i said i sent println("IAC WILL AUTHENTICATION") but nothing happened
i am trying to use ssh now, but it only giving reply SSH-2.0-ROSSSH, and the connection closes after few seconds

i tried fiddler to listen to the authentication by telnet and by web config but i couldnt find the correct header

SSH needs encryption. Microcontroller has not the power for that.

hello, i have the same problem that you have, did you found an answer?