>ssh -o StrictHostkeyChecking=no user@sol8server
Could not create directory '/appl/user/.ssh'.
Failed to add the host to the list of known hosts
(/appl/user/.ssh/known_hosts).
user@sol8server's password: <== I enter password here
Last login: Tue Mar 20 10:01:13 2012 from xxx
Could not chdir to home directory /home/user:
No such file or directory
**** SYSTEM ACTIVITIES MAY BE MONITORED **** <== sol 8 server
What is the purpose of this session: <== sol 8 server
Collect data. <== my response
Thanks, have a fine day and be sure log off after
you are done. <== sol 8 server
sol8server% <== sol 8 server
####
my $expPty = 1; # pty mode
my $expDebug = 3; # Expect debug level
$sshUX = Expect->new; # create Expect object
$sshUX->debug($expDebug); # debugging
$sshUX->log_file($expUXLogFile, "w");
$sshUX->raw_pty($expPty);
$sshUX->expect(10,
[qr /password: $/ => # got password prompt
sub {
my $self = shift;
$self->send("$passw\r");
print "Sent password!\n";#debug
exp_continue;
} # end sub
],
[qr /session:\n$/ => # got reason prompt
sub {
my $self = shift;
$self->send("Get configs\r");
print "Sent session reason!\n";#debug
exp_continue;
} # end sub
],
# Timeout trap
[timeout =>
sub {
$expUXStatus = 1;
print PL "Error,Timeout while waiting
$expTimeOut secs for login on [$UXHost] user[$usr].
Error:" . $sshUX->exp_error() . "\n";
}
],
# EOF trap
[eof =>
sub {
$expUXStatus = 2;
print PL "Error,Premature EOF during
login for [$UXHost] user[$usr]. Error:" .
$sshUX->exp_error() . "\n";
}
],
'-re', qr /%$/, # wait for device prompt '%'
); # End expect for Login processing
print "Finished processing login expect
expUXstatus[$expUXStatus]\n"; # debug
####
Could not create directory '/appl/user/.ssh'.
Failed to add the host to the list of known hosts
(/appl/user/.ssh/known_hosts).
user@sol8server's password:
Last login: Tue Mar 20 09:45:08 2012 from xxx
Could not chdir to home directory /home/user:
No such file or directory
**** SYSTEM ACTIVITIES MAY BE MONITORED ****
What is the purpose of this session:
####
Sent password!
Sent session reason!
Finished processing login expect expUXstatus[2]