telnet

如何检查某个端口是否开启的 3 种方法

北城余情 提交于 2019-12-18 18:53:51
这是一个很重要的话题,不仅对 Linux 管理员而言,对于我们大家而言也非常有帮助。我的意思是说对于工作在 IT 基础设施行业的用户来说,了解这个话题也是非常有用的。他们需要在执行下一步操作前,检查 Linux 服务器上某个端口是否开启。 假如这个端口没有被开启,则他们会直接找 Linux 管理员去开启它。如果这个端口已经开启了,则我们需要和应用团队来商量下一步要做的事。 在本篇文章中,我们将向你展示如何检查某个端口是否开启的 3 种方法。 这个目标可以使用下面的 Linux 命令 来达成: nc:netcat 是一个简单的 Unix 工具,它使用 TCP 或 UDP 协议去读写网络连接间的数据。 nmap:(“Network Mapper”)是一个用于网络探索和安全审计的开源工具,被设计用来快速地扫描大规模网络。 telnet:被用来交互地通过 TELNET 协议与另一台主机通信。 如何使用 nc(netcat) 命令 来查看远程 Linux 系统中某个端口是否开启? nc 即 netcat。netcat 是一个简单的 Unix 工具,它使用 TCP 或 UDP 协议去读写网络连接间的数据。 它被设计成为一个可信赖的后端工具,可被直接使用或者简单地被其他程序或 脚本 调用。 与此同时,它也是一个富含功能的网络调试和探索工具,因为它可以创建你所需的几乎所有类型的连接

Android: how to telnet a phone?

这一生的挚爱 提交于 2019-12-18 11:11:33
问题 I want to know if it's possible to telnet on a certain port of an Android phone connected via USB. I've seen that if I telnet localhost:5556, I go to the emulator. Could I do something similar when I connect a physical device? Which commands could be handled? 回答1: Well, adb shell is the way to connect to the terminal. You can actually telnet to any port you want on the device, there just needs to be an application listening to that port. I don't believe the devices provide the same

How to disable telnet echo in python telnetlib?

对着背影说爱祢 提交于 2019-12-18 06:52:35
问题 Hi I known that I should send 'IAC DONT ECHO' message, but how may I do that using telnetlib?? Here is my test, but it doesn't work. #!/usr/bin/env python2 u"""test""" # -*- coding: utf-8 -*- import sys import telnetlib import time HOST = "10.10.5.1" tn = telnetlib.Telnet(HOST, timeout=1) tn.read_until("login: ") tn.write("login\n") tn.read_until("Password: ") tn.write("pass\n") print "###########" time.sleep(0.5) print tn.read_very_eager() tn.write("ls /\n") time.sleep(0.5) print tn.read

How to disable telnet echo in python telnetlib?

陌路散爱 提交于 2019-12-18 06:52:21
问题 Hi I known that I should send 'IAC DONT ECHO' message, but how may I do that using telnetlib?? Here is my test, but it doesn't work. #!/usr/bin/env python2 u"""test""" # -*- coding: utf-8 -*- import sys import telnetlib import time HOST = "10.10.5.1" tn = telnetlib.Telnet(HOST, timeout=1) tn.read_until("login: ") tn.write("login\n") tn.read_until("Password: ") tn.write("pass\n") print "###########" time.sleep(0.5) print tn.read_very_eager() tn.write("ls /\n") time.sleep(0.5) print tn.read

Java Telnet Library

时间秒杀一切 提交于 2019-12-17 20:28:41
问题 I am really not clear on explaining this requirement but what I need basically is a JSP page that connects to a Unix server and gets the word count of a file and displays on the JSP page. I have looked on various questions here but nothing helped. A sample code would be of much help. Thanks 回答1: Kavin, I guess you must have found some other solution or moved on by now. However, I just came across a requirement that led me to this page. I looked through the somewhat smuckish responses on this

HTTP keep-alive timeout

自古美人都是妖i 提交于 2019-12-17 18:02:02
问题 Can I specify the HTTP timeout or does the server impose a value? For example, if I do: telnet my.server.net 80 Trying X.X.X.X... Connected to my.server.net. Escape character is '^]'. GET /homepage.html HTTP/1.0 Connection: keep-alive Host: my.server.net HTTP/1.1 200 OK Date: Thu, 03 Oct 2013 09:05:28 GMT Server: Apache Last-Modified: Wed, 15 Sep 2010 14:45:31 GMT ETag: "1af210b-7b-4904d6196d8c0" Accept-Ranges: bytes Content-Length: 123 Vary: Accept-Encoding Keep-Alive: timeout=15, max=100

Connecting to smtp.gmail.com via command line

て烟熏妆下的殇ゞ 提交于 2019-12-17 17:32:30
问题 I am in the process of writing an application that sends mail via an valid GMail user ID and password. I just wanted to simulate the SMTP connection on my Windows XP command line, and when I telnet smtp.gmail.com at 465 port - I don't see any thing. A blank command window with title Telnet smtp.gmail.com opens with cursor. When I type in EHLO or usual SMTP handshake commands, the prompt just closes. I am unable to figure out whats going wrong and where. I tried connecting to 587, it does not

expect script to automate telnet login

六眼飞鱼酱① 提交于 2019-12-17 12:59:08
问题 I have been trying to create an expect script to automatically login to my device through telnet If there are no multiple possibilities for the expect command , the script works fine, logs in to the device. #!/usr/bin/expect set timeout 20 set ip [lindex $argv 0] set port [lindex $argv 1] set user [lindex $argv 2] set password [lindex $argv 3] spawn telnet $ip $port expect "'^]'." sleep .1; send "\r"; sleep .1; expect "login:" send "$user\r" expect "Password:" send "$password\r"; interact The

Centos6.5 升级Openssl + Openssh

▼魔方 西西 提交于 2019-12-17 07:32:59
xu言: 平时很懒,都不想写blog。今天(2018.05.15)开始尝试每天写一篇吧,看我自己能坚持多久! 准备工作: 为了防止在操作过程中导致ssh远程中断,首先安装一个telnet-server服务 yum install -y telnet-server chkconfig telnet on # 前提是启动了 chkconfig --list |grep "xinetd" 通过chkconfig --list 查看是否开启 这里开启后telnet 状态是 on Note: 开启后记得在防火墙里面添加23端口,不然...呵呵,你懂的 然后,在外面用你自己的远程工具使用telnet进行测试,测试成功后开始进行升级工作。 所需相关软件包资源汇总: zlib http://www.zlib.net/ pam http://mirror.centos.org/centos/6/os/x86_64/Packages/pam-devel-1.1.1-24.el6.x86_64.rpm openssl http://www.openssl.org/source/ openssh http://www.openssh.com/ 源码安装步骤: zlib 安装 tar xf zlib-1.2.11.tar.gz ./configure --prefix=/usr/local/zlib

Memcached常用指令

你。 提交于 2019-12-16 23:17:53
博文大纲: 一、存储常用的指令 1.set指令 2.add指令 3.replace指令 4.append指令 5.prepend指令 6.cas指令 二、常用的查找指令 1.get指令 2.gets指令 3.delete指令 4.incr指令 5.decr指令 6.stats指令 7.stats items指令 8.stats slabs指令 9.stats sizes指令 10.flush_all指令 一、存储常用的指令 常用的存储数据的指令有: set 命令是保存一个叫做 key 的数据到服务器上; add 命令是添加一个数据到服务器,但是服务器必须保证这个 key 是不存在的,能够保证数据不会被覆盖; replace 命令是替换一个已经存在的数据,如果数据不存在,就是类似 set 功能; 上述指令的语法格式都是一样的,只是指令不一样而已,语法如下: <命令> <键> <标记> <有效期> <数据长度> 各个参数含义如下: <命令>:就是add、set、replace等指令; <键> - key:就是保存在服务器上唯一的一个标识符,不可以与其他的key冲突,否则会覆盖掉原来的数据(使用set命令的话),这个key是为了能够准确的存取一个数据项目; <标记> - flag:标记的是一个16位的无符号整型数据,用来设置服务器跟客户端一些交互的操作; <有效期>