in reply to Re^4: Help Required - Problem Automating SFTP
in thread Help Required - Problem Automating SFTP

Using Putty pscp:

Looking up host "*host_IP*"
Connecting to *host_IP port *port*
Server version: SSH-2.0-OpenSSH_5.1
We claim version: SSH-2.0-PuTTY_Release_0.60
Using SSH protocol version 2
Doing Diffie-Hellman group exchange
Doing Diffie-Hellman key exchange with hash SHA-256
Host key fingerprint is:
ssh-rsa 2048 *fingerprint*
Initialised AES-256 SDCTR client->server encryption
Initialised HMAC-SHA1 client->server MAC algorithm
Initialised AES-256 SDCTR server->client encryption
Initialised HMAC-SHA1 server->client MAC algorithm
Reading private key file "c:/id_cmf_mediatech.ppk"
Using username "*mycompany*".
Offered public key
Offer of public key accepted
Authenticating with public key "rsa-key-20081029"
Access granted
Opened channel for session
Primary command failed; attempting fallback
Started a shell/command
Using SCP1
Connected to *host_IP*

Ok, this looks like it can get me a connection - how can I use this with Net::SFTP::Foreign to automate file downloads and moving files on the clients FTP site?
  • Comment on Re^5: Help Required - Problem Automating SFTP

Replies are listed 'Best First'.
Re^6: Help Required - Problem Automating SFTP
by salva (Canon) on Jan 28, 2009 at 20:34 UTC
    Net::SFTP::Foreign requires SFTP to be working (or allowed) on the remote server.

    If all you are allowed to do is to scp there, then you can try Net::SSH2, Net::SSH::Perl or Net::SCP, though, as you are using keys for authentication, probably just calling the scp (or pscp) program from Perl would be the simplest solution.

    Also, take into account that scp is very limiting and will allow you to transfer files from one side to the other only. For instance, you will not be able to move files around on the server (update: oh, well, unless they allow you to run any remote command and not just scp in client mode).