add copy of the private key to the nodes

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2713 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
lissav 2009-02-09 20:27:46 +00:00
parent 0a35ed1193
commit 122dffca3b
2 changed files with 33 additions and 0 deletions

View File

@ -1194,6 +1194,9 @@ if (! -d \"\$dest_dir\" ) {
}
`cat /tmp/$to_userid/.ssh/authorized_keys >> \$home/.ssh/authorized_keys 2>&1`;
`cat /tmp/$to_userid/.ssh/authorized_keys2 >> \$home/.ssh/authorized_keys2 2>&1`;
`cp /tmp/$to_userid/.ssh/id_rsa \$home/.ssh/id_rsa 2>&1`;
`cp /tmp/$to_userid/.ssh/id_dsa \$home/.ssh/id_dsa 2>&1`;
`chmod 0600 \$home/.ssh/id_* 2>&1`;
`rm -f /tmp/$to_userid/.ssh/* 2>&1`;
rmdir(\"/tmp/$to_userid/.ssh\");
rmdir(\"/tmp/$to_userid\");";

View File

@ -282,6 +282,36 @@ if { [llength $argv] != 0 } {
exec /bin/kill $pid
}
}
set pid [ spawn $scp $directory/id_rsa $to_userid\@$node:/tmp/$to_userid/.ssh ]
expect {
"Are you sure you want to continue connecting (yes/no)?" {
send "yes\r"
exp_continue
}
"*ssword*" {
send "$word\r"
exp_continue
}
"Permission denied*" {
exec /bin/kill $pid
}
}
set pid [ spawn $scp $directory/id_dsa $to_userid\@$node:/tmp/$to_userid/.ssh ]
expect {
"Are you sure you want to continue connecting (yes/no)?" {
send "yes\r"
exp_continue
}
"*ssword*" {
send "$word\r"
exp_continue
}
"Permission denied*" {
exec /bin/kill $pid
}
}
set pid [ spawn $scp $directory/copy.perl $to_userid\@$node:/tmp/$to_userid/.ssh ]
set pid [ spawn $scp $directory/copy.perl $to_userid\@$node:/tmp/$to_userid/.ssh ]
set pid [ spawn $scp $directory/copy.perl $to_userid\@$node:/tmp/$to_userid/.ssh ]
expect {
"Are you sure you want to continue connecting (yes/no)?" {