Re: [Ssh-sftp-perl-users] help needed for SFTP,SCP keys
Brought to you by:
dbrobins
From: Heiko J. <ja...@hb...> - 2008-07-07 07:36:33
|
Am Montag, den 07.07.2008, 00:22 -0700 schrieb Vikas Poonia: > > I have one problem in Perl. I need to implement SFTP-Password, > SFTP-Keys,SCP-Password and Scp-Keys in Perl to transfer the file from > one system to another system. I have already implemented ftp and it is > working fine [...] > But for SFTP, SCP etc I am not able to find the function equivalent to > these like new,login,put etc. > does anyone have any sample code or 2-3 lines which explain all these. > I will be hoghly thankful to all of you. I am using > > use Net::SSH2; > > If have any idea about this please let me know. Thanks in Advance Just connect to the remote host with Net::SSH2 (using password or key) and then use the methods scp_get/scp_put of the Net::SSH2 object or retrieve an Net::SSH2::SFTP object by using the method call "sftp" on the Net::SSH2 object. It's all in the Net::SSH2 (or Net::SSH2::SFTP) documentation. The SYNOPSIS paragraph in Net::SSH2 POD even has a (shortened) example for SFTP transfer. Heiko |