Solved

Using sftp in perl without using NET::SFTP

Posted on 2008-06-18
6
1,376 Views
Last Modified: 2011-09-20
Hello,

Can anyone please help explain how to use sftp in perl without using NET::SFTP. I think it will be possible just by using binary commands in program. For eg. using
sft username\@hostname.
If I want to use this from program where should I put password? If anyone put some sample lines that would be a great help. Urgent replies would be highly appreciated.

Thank you as always!
0
Comment
Question by:Andys1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 13

Assisted Solution

by:MicheleMarcon
MicheleMarcon earned 100 total points
ID: 21819554
0
 

Author Comment

by:Andys1
ID: 21819741
Hello I can not check this link from my office as it is filtered. It would be a great help if you could paste the contents or otherwise I will check it at home. THank you
0
 
LVL 48

Accepted Solution

by:
Tintin earned 200 total points
ID: 21819931
That link doesn't really contain the information you are after.

Firstly, why don't you want to use Net::SFTP?

Here's an example of feeding responses to sftp
open SFTP, "/usr/bin/sftp user@host|" or die "Can not run sftp $!\n";
print SFTP "some command\n";
print SFTP "some other command\n";
print SFTP "exit\n";
close SFTP;

Open in new window

0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 

Author Comment

by:Andys1
ID: 21819984
Thanks Tintin, Acutally I am using perl5.0024 and I copied NET::SFTP and refered the directory using use lib (path) but it threw some exceptions. In my company if I want to install any package then I have to go through various steps and very time consuming so I decided to use SFTP.

Just wondering where to specify the password in above code? I want to schedule this program from cron jobs.
0
 
LVL 16

Assisted Solution

by:xDamox
xDamox earned 200 total points
ID: 21820722
Hello,

I would recommend you use public key authentication with SFTP this will make your program
much simpler to write.

0
 
LVL 48

Expert Comment

by:Tintin
ID: 21820989
Diito regarding ssh keys.
0

Featured Post

RHCE - Red Hat OpenStack Prep Course

This course will provide in-depth training so that students who currently hold the EX200 & EX210 certifications can sit for the EX310 exam. Students will learn how to deploy & manage a full Red Hat environment with Ceph block storage, & integrate Ceph into other OpenStack service

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Six Sigma Control Plans
Suggested Courses

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question