debug output# Creates path to home directory $homedir = "/var/www/localhost/htdocs/$user_name"; # Sets user directroy path $last_user_dir = "/var/www/localhost/htdocs/$last_user_name"; # Start of ssh my $ssh_conn=Net::SSH::Perl->new( $ssh_host, debug => 3, protocol => +'2'); $ssh_conn->login( $ssh_user, $ssh_pass ); ($stdout, $stderr, $exit) = $ssh_conn->cmd( "cp -r $last_user_dir $hom +edir"); $ssh_conn->cmd( "rm -r $last_user_dir" ); $ssh_conn->cmd( "exit" );
dns1: Reading configuration data /root/.ssh/config dns1: Reading configuration data /etc/ssh_config dns1: Allocated local port 1023. dns1: Connecting to primerib.otelco.net, port 22. dns1: Remote protocol version 2.0, remote software version OpenSSH_4.2 dns1: Net::SSH::Perl Version 1.29, protocol version 2.0. dns1: No compat match: OpenSSH_4.2. dns1: Connection established. dns1: Sent key-exchange init (KEXINIT), wait response. dns1: Algorithms, c->s: 3des-cbc hmac-sha1 none dns1: Algorithms, s->c: 3des-cbc hmac-sha1 none dns1: Entering Diffie-Hellman Group 1 key exchange. dns1: Sent DH public key, waiting for reply. dns1: Received host key, type 'ssh-dss'. dns1: Host 'primerib.otelco.net' is known and matches the host key. dns1: Computing shared secret key. dns1: Verifying server signature. dns1: Waiting for NEWKEYS message. dns1: Enabling incoming encryption/MAC/compression. dns1: Send NEWKEYS, enable outgoing encryption/MAC/compression. dns1: Sending request for user-authentication service. dns1: Service accepted: ssh-userauth. dns1: Trying empty user-authentication request. dns1: Authentication methods that can continue: publickey,password,key +board-interactive. dns1: Next method to try is publickey. dns1: Trying pubkey authentication with key file '/root/.ssh/id_dsa' dns1: Authentication methods that can continue: publickey,password,key +board-interactive. dns1: Next method to try is publickey. dns1: Next method to try is password. dns1: Trying password authentication. dns1: Login completed, opening dummy shell channel. dns1: channel 0: new [client-session] dns1: Requesting channel_open for channel 0. dns1: channel 0: open confirm rwindow 0 rmax 32768 dns1: Got channel open confirmation, requesting shell. dns1: Requesting service shell on channel 0. dns1: channel 1: new [client-session] dns1: Requesting channel_open for channel 1. dns1: Entering interactive session. dns1: Sending command: cp -r /var/www/localhost/htdocs/bnorthct /var/www/localhost/htdocs/test dns1: Requesting service exec on channel 1. dns1: channel 1: open confirm rwindow 0 rmax 32768 dns1: channel 1: rcvd eof dns1: channel 1: output open -> drain dns1: input_channel_request: rtype exit-status reply 0 dns1: channel 1: rcvd close dns1: channel 1: input open -> closed dns1: channel 1: close_read dns1: channel 1: obuf empty dns1: channel 1: output drain -> closed dns1: channel 1: close_write dns1: channel 1: send close dns1: channel 1: full closed dns1: channel 2: new [client-session] dns1: Requesting channel_open for channel 2. dns1: Entering interactive session. dns1: Sending command: rm -r /var/www/localhost/htdocs/bnorthct dns1: Requesting service exec on channel 2. dns1: channel 2: open confirm rwindow 0 rmax 32768 dns1: channel 2: rcvd eof dns1: channel 2: output open -> drain dns1: input_channel_request: rtype exit-status reply 0 dns1: channel 2: rcvd close dns1: channel 2: input open -> closed dns1: channel 2: close_read dns1: channel 2: obuf empty dns1: channel 2: output drain -> closed dns1: channel 2: close_write dns1: channel 2: send close dns1: channel 2: full closed dns1: channel 3: new [client-session] dns1: Requesting channel_open for channel 3. dns1: Entering interactive session. dns1: Sending command: exit dns1: Requesting service exec on channel 3. dns1: channel 3: open confirm rwindow 0 rmax 32768 dns1: channel 3: rcvd eof dns1: channel 3: output open -> drain dns1: input_channel_request: rtype exit-status reply 0 dns1: channel 3: rcvd close dns1: channel 3: input open -> closed dns1: channel 3: close_read dns1: channel 3: obuf empty dns1: channel 3: output drain -> closed dns1: channel 3: close_write dns1: channel 3: send close dns1: channel 3: full closed cp: missing destination file Try `cp --help' for more information. bash: line 1: /var/www/localhost/htdocs/test: No such file or director +y
Edited by planetscape - added readmore tags
In reply to Net::SSH::Perl remote copying issues by rbnorthcutt
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |