Operating System - Linux
1753868 Members
7299 Online
108809 Solutions
New Discussion юеВ

Encrypted Password in ftp

 
Raghu Chikkamenahalli
Frequent Advisor

Encrypted Password in ftp

Hello All,

Is it possible to use encrypted passwd in ftp.

For example,
USER=user1
PASS="passwd" # Currently it in plain text, need
# to use the encrypted string.

ftp -n ftp_server <user ${USER} ${PASS}
put filename.txt
bye
EOF

Kindly show some pointers for the same.

Regards,
Raghu
8 REPLIES 8
Dennis Handly
Acclaimed Contributor

Re: Encrypted Password in ftp

>Is it possible to use encrypted passwd in ftp.

That's probably the same level of security of rcp with .rhosts.

I don't think you can do this. You can put your password in a .netrc file.
F Verschuren
Esteemed Contributor

Re: Encrypted Password in ftp

sorry this is not poseble, if you want to encript you can use sftp and keys, than you will not have a passwd in your scripts.
the .netrc file is alsow useble, but then the passwd is in plain tektst in the users home dir.

sorry ftp is just not secure...
Nitin Kumar Gupta
Trusted Contributor

Re: Encrypted Password in ftp

Dear Raghu,

You can keep the user name and password in an encrypted file created by crypt command.

For details check the man page of crypt.

If you want more assistance, let me write.

Rgds
-NKG-
Steven Schweda
Honored Contributor

Re: Encrypted Password in ftp

> Is it possible to use encrypted passwd in
> ftp.

Not really. You're talking to an FTP server,
and it almost certainly wants a plain-text
user name and password.

> You can keep the user name and password in
> an encrypted file created by crypt command.

And then you have to deal with the "crypt"
password. What's the point?

If you want to avoid using a plain-text
password, then you _should_ be asking how to
transfer a file without using FTP. You don't
seem to like suggestions to use SFTP, so it's
not clear what will make you happy. Perhaps
you should begin again, and state the actual
problem to be solved, and your actual
requirements and restrictions. This often
works better than asking how to implement
some impossible part of a bad solution.
lawrenzo
Trusted Contributor

Re: Encrypted Password in ftp

Hi,

if you dont want to put the password in the script you can use the .netrc file and specify a switch with the ftp command ( see the man page )

as far as security goes I would not use this method however I would configure either sftp or scp using the ssh protocols etc.

hth

Chris
hello
Geoff Wild
Honored Contributor

Re: Encrypted Password in ftp

No - you can't encrypt a password in ftp - non secure protocol.

Use sftp instead, setup keys to allow login without a password. (that way you don't have to embed the password in a script!).

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Bill Hassell
Honored Contributor

Re: Encrypted Password in ftp

As mentioned, ftp is an industry standard protocol and there is nothing you can do to change the plaintext password requirment. Eve burying the password in $HOME/.netrc won't remove the requirement to transmit the plaintext string across the network. It can still be sniffed by anyone with access to your network.

While ftp is the most common protocol available for exchanging files, it is no longer useful in today's security environments. If the password is a concern, then the data is probably important and must be protected. The only compatible file transfer that is secure for both login/password as well as data is ssh (and it's siblings scp and sftp). You can download ssh from HP at software.hp.com.


Bill Hassell, sysadmin
Raghu Chikkamenahalli
Frequent Advisor

Re: Encrypted Password in ftp

Hello All,

Thanks for the pointers.
I have used sftp in place of ftp by exchanging the keys.

Regards,
Raghu.