|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: Rickey Ingrassia (r1ckey
attbi.com)Date: Tue May 21 2002 - 13:58:22 CDT
On 05/20/02 12:15:14, Francesc Dantí <coco
vallesnet.org> wrote:
--snip--
>
> It runs correctly :), but there is a problem:
> I've to write my login and password in plain text
> in the script (*as shown below).
> I know that i can read-protect the script,
> but i doesn't like to have my password in plain text.
>
> Is there any manner to encrypt it, as linux do in passwd files?
> Or any other module that permits me to do the same with
> encrypted password?
Why not change the script to get the password from the command line or prompt
for the password. See my (untested) mods to your script. Or try to compile
the script (using perlcc).
>
> Thanks in advance!
>
> p.s. I can't use ssh in the remote server, it only runs ftp!
> ____________________________________________________
> *SOME SCRIPT LINES
>
> use Net::FTP
# get password from command line or prompt for password
# you may want to do more error checking, you could also
# get alot more elaborate with this method
#
# CODE NOT TESTED!!!
#
$passwd = $ARGV[0];
if (!$passwd) {
print "Please enter FTP password: ";
chomp($passwd = <STDIN>);
}
> $ftp = Net::FTP->new("remote_server", Debug => 0);
# replace PASSWORD string with $passwd variable
$ftp->login("LOGIN", "$passwd");
> $ftp-> MY COMMANDS
> ____________________________________________________
--rickey
-- To unsubscribe, e-mail: suse-security-unsubscribesuse.com For additional commands, e-mail: suse-security-help
suse.com Security-related bug reports go to security
suse.de, not here
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]