Mam taki skrypcik do backupu bazy. Wszystko gra do momentu, kiedy wywoluje komende 'scp' (linia 36) - w tym momencie skrypt sie zatrzymuje - normalnie scp powinno zapytać o hasło.
<?php if(!($shell = ssh2_shell($sshc, 'xterm'))){ } else { /* * sending commands */ if ($server['su_pass'] !== '') { } $mysqlhotcopy_options = ''; if ($server['mysql_user'] !== '') { $mysqlhotcopy_options = " --user={$server['mysql_user']} "; } if ($server['mysql_pass'] !== '') { $mysqlhotcopy_options = " --password={$server['mysql_pass']} "; } fwrite($shell, "mysqlhotcopy {$mysqlhotcopy_options} --regexp='.+' {$server['remote_backup_dir']};" . PHP_EOL); fwrite($shell, "scp -v -r {$server['remote_backup_dir']} {$backup_server['user']}@{$backup_server['host']}:{$temp_dir}".PHP_EOL); $data = ""; { break; } } } ?>
i załączam jeszcze debug z scp:
CODE
debian:~# scp -v -r /tmp/mysql_backup root@192.168.0.103:/tmp/backup_temp
Executing: program /usr/bin/ssh host 192.168.0.103, user root, command scp -v -r -t /tmp/backup_temp
OpenSSH_4.3p2 Debian-9etch3, OpenSSL 0.9.8c 05 Sep 2006
debug1: Reading configuration data /etc/ssh/ssh_config^M
debug1: Applying options for *^M
debug1: Connecting to 192.168.0.103 [192.168.0.103] port 22.^M
debug1: Connection established.^M
debug1: permanently_set_uid: 0/0^M
debug1: identity file /root/.ssh/identity type -1^M
debug1: identity file /root/.ssh/id_rsa type 1^M
debug1: identity file /root/.ssh/id_dsa type -1^M
debug1: Remote protocol version 2.0, remote software version OpenSSH_4.3p2 Debian-9etch3^M
debug1: match: OpenSSH_4.3p2 Debian-9etch3 pat OpenSSH*^M
debug1: Enabling compatibility mode for protocol 2.0^M
debug1: Local version string SSH-2.0-OpenSSH_4.3p2 Debian-9etch3^M
debug1: An invalid name was supplied
Cannot determine realm for numeric host address
^M
debug1: An invalid name was supplied
A parameter was malformed
Validation error
^M
debug1: An invalid name was supplied
Cannot determine realm for numeric host address
^M
debug1: An invalid name was supplied
A parameter was malformed
Validation error
^M
debug1: SSH2_MSG_KEXINIT sent^M
debug1: SSH2_MSG_KEXINIT received^M
debug1: kex: server->client aes128-cbc hmac-md5 none^M
debug1: kex: client->server aes128-cbc hmac-md5 none^M
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent^M
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP^M
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent^M
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY^M
debug1: Host '192.168.0.103' is known and matches the RSA host key.^M
debug1: Found key in /root/.ssh/known_hosts:7^M
debug1: ssh_rsa_verify: signature correct^M
debug1: SSH2_MSG_NEWKEYS sent^M
debug1: expecting SSH2_MSG_NEWKEYS^M
debug1: SSH2_MSG_NEWKEYS received^M
debug1: SSH2_MSG_SERVICE_REQUEST sent^M
debug1: SSH2_MSG_SERVICE_ACCEPT received^M
debug1: Authentications that can continue: publickey,password^M
debug1: Next authentication method: publickey^M
debug1: Trying private key: /root/.ssh/identity^M
debug1: Offering public key: /root/.ssh/id_rsa^M
debug1: Authentications that can continue: publickey,password^M
debug1: Trying private key: /root/.ssh/id_dsa^M
debug1: Next authentication method: password^M
Pomóżcie ludzie, bo już nie wiem gdzie szukać.