PNG  IHDR* pHYs+ IDATx]n#; cdLb Ǚ[at¤_:uP}>!Usă cag޿ ֵNu`ݼTâabO7uL&y^wFٝA"l[|ŲHLN밪4*sG3|Dv}?+y߉{OuOAt4Jj.u]Gz*҉sP'VQKbA1u\`& Af;HWj hsO;ogTu uj7S3/QzUr&wS`M$X_L7r2;aE+ώ%vikDA:dR+%KzƉo>eOth$z%: :{WwaQ:wz%4foɹE[9<]#ERINƻv溂E%P1i01 |Jvҗ&{b?9g=^wζXn/lK::90KwrюO\!ջ3uzuGv^;騢wq<Iatv09:tt~hEG`v;3@MNZD.1]L:{ծI3`L(÷ba")Y.iljCɄae#I"1 `3*Bdz>j<fU40⨬%O$3cGt]j%Fߠ_twJ;ABU8vP3uEԑwQ V:h%))LfraqX-ۿX]v-\9I gl8tzX ]ecm)-cgʒ#Uw=Wlێn(0hPP/ӨtQ“&J35 $=]r1{tLuǮ*i0_;NƝ8;-vݏr8+U-kruȕYr0RnC]*ެ(M:]gE;{]tg(#ZJ9y>utRDRMdr9㪩̞zֹb<ģ&wzJM"iI( .ꮅX)Qw:9,i좜\Ԛi7&N0:asϓc];=ΗOӣ APqz93 y $)A*kVHZwBƺnWNaby>XMN*45~ղM6Nvm;A=jֲ.~1}(9`KJ/V F9[=`~[;sRuk]rєT!)iQO)Y$V ی ۤmzWz5IM Zb )ˆC`6 rRa}qNmUfDsWuˤV{ Pݝ'=Kֳbg,UҘVz2ﴻnjNgBb{? ߮tcsͻQuxVCIY۠:(V뺕 ٥2;t`@Fo{Z9`;]wMzU~%UA蛚dI vGq\r82iu +St`cR.6U/M9IENDB` REDROOM
PHP 5.6.40
Preview: ssh.pl Size: 1.89 KB
//usr/share/doc/perl-Expect/examples/ssh.pl

#!/usr/bin/perl
#
#      A Simple Terminal Resizing Example
#      (C) 2006 Jeff Carr
#      This script can be used under the same terms as Perl.
#
# This script is a simple example of how handle terminal
# window resize events (transmitted via the WINCH signal)
# -- Jeff Carr <jcarr@linuxmachines.com>
#
# NOTE: I (the Expect maintainer) strongly object against using Expect
# to automate ssh login. There are better methods, see ssh-keygen.
# If you use this example as a stub to control a remote application,
# please remove the password-part and use public-key authentication
# instead.
# -- Roland Giersig <RGiersig@cpan.org>
#

if( ! defined $ARGV[0] ) {
	print "Usage: ssh.pl <host> [ <username> [ <password> ] ]\n";
	exit;
}

my ($host, $username, $password) = @ARGV;
$username = $ENV{USER} if $username eq "";

use Expect;
use IO::Pty;

my $spawn = new Expect;
$spawn->raw_pty(1);

# This gets the size of your terminal window
$spawn->slave->clone_winsize_from(\*STDIN);

my $PROMPT;

# This function traps WINCH signals and passes them on
sub winch {
	my $signame = shift;
	my $pid = $spawn->pid;
	$shucks++;
	print "count $shucks,pid $pid, SIG$signame\n";
	$spawn->slave->clone_winsize_from(\*STDIN);
	kill WINCH => $spawn->pid if $spawn->pid;
}
$SIG{WINCH} = \&winch;  # best strategy

$spawn=Expect->spawn("ssh $username\@$host");
# log everything if you want
# $spawn->log_file("/tmp/autossh.log.$$");

my $PROMPT  = '[\]\$\>\#]\s$';
my $ret = $spawn->expect(10,
	[ qr/\(yes\/no\)\?\s*$/ => sub { $spawn->send("yes\n"); exp_continue; } ],
	[ qr/assword:\s*$/ 	=> sub { $spawn->send("$password\n") if defined $password;  } ],
	[ qr/ogin:\s*$/		=> sub { $spawn->send("$username\n"); exp_continue; } ],
	[ qr/REMOTE HOST IDEN/ 	=> sub { print "FIX: .ssh/known_hosts\n"; exp_continue; } ],
	[ qr/$PROMPT/ 		=> sub { $spawn->send("echo Now try window resizing\n"); } ],
);

# Hand over control
$spawn->interact();
exit;

Directory Contents

Dirs: 1 × Files: 3

Name Size Perms Modified Actions
kibitz DIR
- drwxr-xr-x 2025-04-06 18:14:30
Edit Download
141 B lrw-r--r-- 2017-05-15 15:55:28
Edit Download
470 B lrw-r--r-- 2017-05-15 15:55:28
Edit Download
1.89 KB lrw-r--r-- 2017-05-15 15:55:28
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).
© 2026 REDROOM — Secure File Manager. All rights reserved. Built with ❤️ & Red Dark UI