telnet

What does “\\r” do in the following script?

无人久伴 提交于 2019-11-27 13:36:39
I am using following script to reboot my router using Telnet: #!/usr/bin/env python import os import telnetlib from time import sleep host = "192.168.1.1" user = "USER" password = "PASSWORD" cmd = "system restart" tn = telnetlib.Telnet(host) sleep(1) tn.read_until("Login: ") tn.write(user + "\n\r") sleep(1) tn.read_until("Password: ") tn.write(password + "\n\r") sleep(1) tn.write(cmd + "\n\r") I don't know why but removing "\r" from above code make the script non-working. So what does "\r" do in this script and when to use "\r" in general? Note: I know about "Carriage Return" but still could

get all keys set in memcached

泄露秘密 提交于 2019-11-27 10:14:09
How can I get all the keys set in my memcached instance(s)? I tried googling, but didn't find much except that PHP supports a getAllKeys method , which means it is actually possible to do this somehow. How can I get the same within a telnet session? I have tried out all the retrieval related options mentioned in memcached cheat sheet and Memcached telnet command summary , but none of them work and I am at a loss to find the correct way to do this. Note: I am currently doing this in development, so it can be assumed that there will be no issues due to new keys being set or other such race

linux重定向串口打印到telnet ssh远程中断

六月ゝ 毕业季﹏ 提交于 2019-11-27 09:59:07
如果要实时显示printk 信息 可以参考 https://www.cnblogs.com/ChenChangXiong/p/11357416.html 有时候调试需要 但是没有串口 使用telnet ssh远程登录的时候 不能显示启动时候运行的程序的打印 这个时候需要重定向 源码: 1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <string.h> 4 #include <fcntl.h> 5 #include <sys/ioctl.h> 6 #include <unistd.h> 7 8 int main(int argc, char *argv[]) 9 { 10 int tty = -1; 11 char *tty_name = NULL; 12 13 if(argc < 2) 14 { 15 printf("miss argument\n"); 16 return 0; 17 } 18 19 /* 获取当前tty名称 */ 20 tty_name = ttyname(STDOUT_FILENO); 21 printf("tty_name: %s\n", tty_name); 22 23 if(!strcmp(argv[1], "on")) 24 { 25 /* 重定向console到当前tty */ 26

TCP/IP基础知识

霸气de小男生 提交于 2019-11-27 09:30:30
第一部分 TCP/IP 基础知识 TCP/IP分层及各层主要协议 数据链路层: SLIP 、 PPP 网络层: IP 、 ARP 、 RARP 、 ICMP 传输层: TCP 、 UDP 应用层: FTP 、 TELNET 、 SMTP 、 HTTP 、 TFTP ===================== 这部分与 宇航出版社 的《 Microsoft Windows NT4.0 环境下的 TCP/IP 网络互联》中的 第一、二章(除 ARP 外) 对应 首先我们这门课是 TCP/IP 在 Windows NT 中的应用,并不完全讲 TCP/IP 协议,所以有一些 TCP/IP 理论方面的知识并没有涉及到。在讲 TCP/IP 在 Windows NT 中的应用时,我们先回顾一下,在网络基础中讲到的网络的 OSI 模型,假如有同学从 TCP / IP 学起,此处作一个铺垫。 第一课 OSI 模型 (open system interface) OSI 模型最初是用来作为开发 网络通信协议族 的一个 工业参考标准 。通过严格遵守 OSI 模型, 不同的网络技术 之间可以轻易地实现互操作。 应用层 Application Layer 表示层 Present Layer 会话层 Semission Layer 传输层 Transport Layer 网络层 Internet Layer

Creating a script for a Telnet session?

坚强是说给别人听的谎言 提交于 2019-11-27 07:04:30
Does anyone know of an easy way to create a script that can connect to a telnet server, do some usual telnet stuff, and then log off? I am dealing with users who are not familiar with telnet and the commands they will need to run. All I want is for them to double-click on a script, and have that script automatically execute the commands for them. You're probably wondering, "What platform are the users on?" They will be on both Windows and Linux. Implementations in languages like Perl, Java, or Python are acceptable. I see that Perl has a Net:: Telnet module. Has anyone used that? My ideal

Maximum number of concurrent connections on a single port (socket) of Server

筅森魡賤 提交于 2019-11-27 06:59:41
What could be the maximum number of concurrent Clients (using different port number) that could communicate to a Server on the same port (Single socket) ? What are the factors that could influence this count ? I am looking for this information w.r.t telnet in Linux environment. This depends in part on your operating system. There is however no limit on a specific port. There is a limit on the number of concurrent connections however, typically limited by the number of file descriptors the kernel supports (eg 2048). The thing to remember is that a TCP connection is unique and a connection is a

Looking for Java Telnet emulator [closed]

假装没事ソ 提交于 2019-11-27 05:20:00
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I am writing a back end program that telnets into a server, runs some commands and saves all the output from those commands. Something just like Expect. I would like to use an open source solution that is well supported and runs with JDK 6. I have found 3 options so far and would like some help deciding which

Is it possible to use a batch file to establish a telnet session, send a command and have the output written to a file?

删除回忆录丶 提交于 2019-11-27 02:42:16
问题 I run the following batch file to establish a telnet session to a device and create a file that will hold information pulled from the device. CD\ COLOR 0E CLS @echo off ECHO This will start the connection to the Heraeus QuicK-Lab DATACAST ENtouch. pause telnet 172.17.0.16 4224 -f C:\LogFiles\Datacast.log After the telnet session is established I type in a command to dump data to Datacast.log as specified in the last line of code. I am hoping to include the command ("M3,1,999" for example) in

Using telnet in a C Program

匆匆过客 提交于 2019-11-27 02:21:14
问题 I am working on a robot automation project and I have run into a road block. To control the robot, one needs to connect with it wirelessly via telnet and send commands through the tcp/ip protocol. (ex. The 'Mabc' command moves it forward based on the left wheel speed (a), the right wheel speed (b) and time (c)). What I am trying to do is do some calculations in a C program and then send a message to the robot based on the value of the calculation. How can send commands via tcp/ip protocol in

C# Library for SSH and Telnet [closed]

不问归期 提交于 2019-11-27 02:08:27
问题 I'm looking for a C# library that provides access to both SSH and Telnet under the same interface. What would be a good choice? 回答1: I recommend Granados for SSH stack. It has been used in many products. I recommend this code project page for telnet stack. You can also download Poderosa terminal emulator. It's using Granados as the SSH stack and it has its own implementation of telnet stack. Poderosa is very pluggable. It provides a good abstraction layer on the network stacks. If you don't