ChinaUnix.net
相关文章推荐:

expect ssh

expect1.1> spawn ssh -v -l user 171.1.1.1 exect1.2>interact 会提示: read_passphrase:cannot open /dev/tty:No such device or address 有人遇到过这个问题吗?

by lynnLinux - Linux系统管理 - 2007-07-25 14:55:16 阅读(1433) 回复(1)

相关讨论

[code]#!/bin/bash expect -c " set timeout 1200; spawn /usr/bin/ssh 192.168.0.77 df -lh | awk '/sda1/{if ($5>85) system("perl -w ./send.pl");else print "OK"}' expect { \"*yes/no*\" {send \"yes\r\"; exp_continue} \"*password*\" {send \"123456\r\";} } expect eof;"[/code]报错。请求修改。

by squall1 - Shell - 2010-05-16 15:33:14 阅读(1658) 回复(2)

#!/usr/bin/expect spawn ssh xb@128.1.1.1 expect "*password:" send "111111\r" 为啥运行完之后还在本地机器上没有登陆上去呢,也没有错误显示。 另外如何在expect中加入shell命令呢 比如想在开始加一句 setenv TERM xterm 谢谢

by letwave - Shell - 2008-02-26 16:16:54 阅读(3855) 回复(5)

感谢您能抽出时间阅读这个问题 脚本代码如下: #!/usr/bin/expect spawn /data/svn/trunk/application/dataabstract/day/safe1000/md5_cmd_a3a5ac7950bab78ea3a4c9d2bc56e26 expect "passwor" send "keyword\n" expect eof exit 其中 md5_cmd_a3a5ac7950bab78ea3a4c9d2bc56e26 文件中包含了一条 ssh 登录远程服务器命令: ...

by npurple - Shell - 2012-04-11 20:17:26 阅读(2400) 回复(11)

ssh再执行ftp命令 代码段: ... my $ftpcmd = <ssh->exec("cd $path&&$ftpcmd"); ... 为什么没有上传成功, 文件是存在的,没有错误返回。有大神遇到过吗?

by jiwang1980 - Perl - 2011-06-28 18:48:15 阅读(2107) 回复(0)

http://bbs.chinaunix.net/viewthread.php?tid=1070390&highlight=ssh+%D7%D4%B6%AF%B5%C7%C2%BC + #!/usr/bin/expect -f set ipaddress [lindex $argv 0] set passwd [lindex $argv 1] set timeout 5 spawn ssh [email=root@$ipaddress]root@$ipaddress[/email] #######Input "yes" when prompt "yes/no"############ expect { "yes/no" { send "yes\r"; exp_continue} "password:" { send "$passwd\r" } } #################...

by huanghaojie - Linux文档专区 - 2008-11-19 15:17:17 阅读(787) 回复(0)

expect 命令已经安装可以使用scp拷贝文件了,这次想不用输密码就ssh登录 但是遇到问题了 请指教 代码如下: #!/usr/bin/expect -f set passwd abcd spawn ssh [email]root@192.168.80.39[/email] set timeout 30 expect "yes/no" send "yes\r" expect "*password*" send "$passwd\r" 执行完后没有任何结果。

by alphasniper - Linux系统管理 - 2014-01-05 20:14:08 阅读(2240) 回复(4)

[root@sfdg1 expect]# more exp_ssh.exp #!/usr/bin/expect #exp_internal 1 set user root set ipaddr [lindex $argv 0] set passwd [lindex $argv 1] spawn ssh $user@$ipaddr expect { "*password:" { send "$passwd\r" } } [root@sfdg1 expect]# [root@sfdg1 expect]# ./exp_ssh.exp 192.168.56.120 root spawn ssh [email]root@192.168.56.120[/email] [email]root@192.168.56.120[/email]'s password: [root@sfdg1 ...

by hellosk - Shell - 2013-08-08 11:45:39 阅读(5357) 回复(5)

expect写了个脚本,想在远程主机上执行一个脚本,这个脚本执行需要30min; 代码如下: #!/usr/bin/expect -f set ip [lindex $argv 0 ] set timeout 10 spawn ssh test@$ip expect { "*yes/no" { send "yes\r"; exp_continue} "*assword:" { send "$password\r" } } expect "]$" send "ls\r" expect "]$" send "chmod +x run.sh\r" expect "]$" send "./run.sh\r" expect "]$" send "exit\r" expec...

by whatever890603 - Shell - 2014-05-27 09:27:05 阅读(2256) 回复(9)

expect实现自动ssh登录,不过有个问题目前没有搞明白,用ssh name@host 登录, 有两种情况 第一种:如果是第一次会有一个 The authenticity of host '192.168.10.23 (192.168.10.23)' can't be established. RSA key fingerprint is 54:e6:ce:7a:aa:c0:95:31:58:0d:56:f6:ee:b5:8a:14. Are you sure you want to continue connecting (yes/no)? 的提示,点YES后,然后输入密码. 第二种:ssh 主机直接出输入密码的提示 在expect中如何对这...

by er_shi - Shell - 2011-07-15 09:38:47 阅读(6732) 回复(6)

:dizzy: 错误信息:sshAuthenticationError Login timed out. The input stream currently has the contents bellow: at /usr/lib/perl5/site_perl/5.8.8/expect.pm line 828 代码[code]#!/usr/bin/env perl use Net::ssh::expect; use strict; my $i; my $command=$ARGV[1]; for($i=0;$i<$ARGV[0];$i++){ my $ip=$ARGV[$i+2]; print $ip; my $ssh=Net::ssh::expect->new( host => $ip...

by Mr-Summer - Perl - 2010-12-13 15:32:37 阅读(4460) 回复(3)