Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: scp perl

by halley (Prior)
on Feb 05, 2008 at 16:48 UTC ( #666345=note: print w/ replies, xml ) Need Help??


in reply to scp perl

This seems to have nothing to do with perl... but I'll bite.

system('scp login:password@host:path/to/file.txt file_backup.txt'); if (-f 'file_backup.txt') { system('ssh login:password@host rm path/to/file.txt'); }
More safeguards are necessary here, and I shudder to see a password in plaintext. Learn to use ssh's authorized_keys file at the minimum. Reading all of ssh's manpage until enlightenment comes is better.

--
[ e d @ h a l l e y . c c ]


Comment on Re: scp perl
Download Code
Re^2: scp perl
by pc88mxer (Vicar) on Feb 06, 2008 at 00:41 UTC
    One perl related safe-guard I'd recommend is to use the multi-argument form of system:

    system('scp', "login:password@host:path/to/file.txt", "file_backup.txt");

    Also, I'd second the use of authorized_keys. Not only is it more convenient, but it centralizes the management of your security which very helpful.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://666345]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (10)
As of 2014-12-18 12:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (51 votes), past polls