MOON
Server: Apache
System: Linux vps.thepromohut.com 2.6.18-398.el5 #1 SMP Tue Sep 16 20:51:48 EDT 2014 i686
User: caretrak (507)
PHP: 5.2.10
Disabled: NONE
Upload Files
File: //scripts.20110601.041516.15411/trustme
#!/usr/bin/perl
# cpanel4 - scripts        Copyright(c) 1997-2002 cPanel, Inc..
#                                 All rights Reserved.
# copyright@cpanel.net      http://cpanel.net
# This code is subject to the cpanel license. Unauthorized copying is prohibited
chomp($kk = <STDIN>);
($host,$root) = split(/\s/, $kk);
if (! -e "/root/.ssh/identity") {
	system("/usr/bin/ssh-keygen -t rsa1 -f /root/.ssh/identity -P \"\"");
}
if (! -e "/root/.ssh/identity2") {
	system("/usr/bin/ssh-keygen -t rsa -f /root/.ssh/id_rsa -P \"\"");
	system("/usr/bin/ssh-keygen -t dsa -f /root/.ssh/id_dsa -P \"\"");
}

open(IP,"/root/.ssh/identity.pub");
chomp($ip = <IP>);
close(IP);

if ($ip !~ /^\d+/) {
	$ip =~ s/^\S+\s//g;
}

open(SSHS,">/root/.sshscript");
print SSHS "echo Script ok\n";
print SSHS "mkdir /root/.ssh\n";
print SSHS "chmod 700 /root/.ssh\n";
print SSHS ("echo \'$ip\' >> /root/.ssh/authorized_keys\n");
print SSHS "chmod 700 /root/.ssh/authorized_keys\n";
print SSHS "echo Copy Complete\n";
close(SSHS);
open(SC,"|/scripts/ssh.expect $host");
print SC "$root";
close(SC);
sleep(1);
print "\n\n";
open(SC2,"|/scripts/ssh2.expect $host");
print SC2 "$root";
close(SC2);
sleep(1);
print "Trust Relationship Created!\n";