Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

292
Views
Cuando uso el cliente telnet, después de usar el comando .exec, quiero presionar la tecla Intro, pero no sé cómo hacerlo.

Estoy tratando de conectarme a un enrutador que se ejecuta en gns3 usando telnet. Después de una conexión exitosa, quiero ejecutar algunos comandos y quiero presionar la tecla Intro después de cada comando.

aquí está mi código:

 const myFunc = async () => { const connection = new Telnet(); // these parameters are just examples and most probably won't work for your use-case. const params = { host: "localhost", port: 5000, shellPrompt: ">", // or negotiationMandatory: false timeout: 1500, }; try { await connection.connect(params); } catch (error) { // handle the throw (timeout) console.log(`error: ${error}`); } const res = await connection.exec("enable"); //here i want to press enter key const res1 = await connection.exec("show running-config", { shellPrompt: "#", }); //here i want to press enter key console.log(`res1: ${res1}`); };

Después de ejecutar este código, se conecta con éxito al enrutador y luego ejecuta el primer comando enable.

ingrese la descripción de la imagen aquí

Pero no está enviando la tecla Intro por eso recibo el error:

ingrese la descripción de la imagen aquí

Por favor guíame, cómo resolver el problema.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!