我开发了这个expect脚本,TELNET_TEST.expect来测试远程计算机上的TELNET连接。
这个脚本应该通过目标机器上的telnet连接,等待登录提示,发送密码,然后退出。
这个脚本确实有效,在示例1中,您可以看到脚本成功地通过telnet登录,然后退出,但是有非常混乱的事情发生了,(对我来说)。
为什么我会得到一个退出状态1?我想我应该退出0级.
请让我知道为什么我要退出状态1?另外,为了获得我预期的退出代码,我需要修改我的脚本吗?
我的预期脚本:
more TELNET_TEST.expect
#!/usr/bin/expect --
set LO
我有一个运行在虚拟化Debian8.5(Windows10下的VirtualBox)下的测试游戏服务器;这台Linux机器在网络上有自己的IP地址。游戏服务器使用端口2106、7777和10241。我成功地配置了我的机器,使游戏服务器可以从WAN访问,这3个端口被重定向到Linux机器IP 192.168.1.70 (测试是从我的Windows机器192.168.1.1进行的)。
我在Windows上做了一些远程登录测试,比如:
telnet 192.168.1.70 2106 ==> Test OK
telnet 192.168.1.70 7777 ==> Test OK
tel
基于本指南,我试图使用linux的telnet发送一封测试邮件。
https://linuxconfig.org/send-an-email-using-telnet
但连接立即断开:
$ telnet smtp.gmail.com 465
Trying 108.177.126.108...
Connected to smtp.gmail.com.
Escape character is '^]'.
MAIL FROM: asdasd@asd.Connection closed by foreign host
如何保持连接打开足够长的时间来发送测试邮件?
我正在将kerberos集成到我们的项目中,首先我已经部署了一个KDC服务器,然后我想测试它是否工作,所以我使用kerberos telnet进行了测试,但我收到了以下错误消息:
Escape character is '^]'.
>>>TELNET: I support auth type 2 6
>>>TELNET: I support auth type 2 2
>>>TELNET: I support auth type 2 0
>>>TELNET: I support auth type 1 2
这个脚本的输出是包装的,这是我不想要的。
use strict;
use Net::Telnet;
system("mode 500,6000");
print "passwd: ";
my $passwd=<>;
chomp($passwd);
my $telnet = Net::Telnet->new(Host=>'linux63.blahblah.edu',Prompt=>'/l+inux63> $/');
$telnet->waitfor('/login/');
$
我正在尝试设置我的EBS卷的自动快照,为此,我设置了Amazon Cli工具,但当我尝试使用它们时,收到以下错误:
HTTPSConnectionPool(host='ec2.us-west-2a.amazonaws.com', port=443): Max retries exceeded with url: / (Caused by <class 'socket.gaierror'>: [Errno -2] Name or service not known)
我做了telnet ec2.us-west-2a.amazonaws.com 443,
我从Linux服务器telnet到windows机器以运行python脚本。该脚本将继续运行约25分钟,但由于Telnet已关闭,它始终在运行约20分钟后退出。在Linux服务器上显示"connection closed by foreign host“。
有没有办法在脚本运行期间保持会话打开?
windows上的Telnet配置:
The following are the settings on localhost
Alt Key Mapped to 'CTRL+A' : YES
Idle session timeout : Not On
我正在运行以下简单的telnet脚本,它只是登录到机器并退出。
同一脚本在一个Linux服务器上运行良好(通过1000次迭代),但在另一个Linux服务器(例如200次尝试后失败)失败(一致)。
在失败的情况下,失败所需的迭代次数是不同的,但是失败是持久的。
#!/usr/bin/perl
use Net::Telnet;
my $loop = 0;
my $dumpfile = "dump.log";
my $inputfile = "input.log";
for ($loop =1; $loop <=1000; $loop++) {