Re: How to get encrypted user password
Re: How to get encrypted user password
- Subject: Re: How to get encrypted user password
- From: Roger Pau Monné <email@hidden>
- Date: Wed, 30 Dec 2009 04:16:02 +0100
Hello,
Thanks for the replies, I meant a ftpd server, sorry, my english is not very good. Anyway I have been able to establish the control and data connection, and the server has some basic commands, like put, ls, get, noop, type, pwd, mode, syst... I was just using a dummy user, called ftp, and checking against a constant for the password. I've never had to do anything related to user auth, so I'm sorry if my question sounded foolish, thanks for the quick reply.
2009/12/30 Terry Lambert
<email@hidden>
I think you meant an ftpd, not a client. Clients do not use encrypted passwords, they use plaintext with a nonce or encryption over the wire using keys obtained via Diffie-Helman key exchange, or for regular FTP, the just send in the clear (which is why no one uses plain FTP any more).
You have to be root to get the post-hashed password value, and it's only useful for hashing your plaintext that you read from the user for comparing in an ftpd to see if it's correct (in the ftpd). Most people use PAM modules for this.
PS: This is a pretty basic question, and you will be unlikely to be able to successfully establish a login session correctly if you need to ask it. Getting the password verified is only the first of many, many steps.
-- Terry
On Dec 29, 2009, at 6:21 PM, Roger Pau Monné <
email@hidden> wrote:
Hello,
I'm implementing a very simple FTP client, and to do the login I would like to check against system users instead of using my own database, so that I can give the proper permissions to the newly created process that I've spawned with fork. What's the best way for doing this in C?
I've read about the getpwnam function, that returns a struct passwd that has the field pw_passwd to compare against (using the crypt function), but this field only contains asterisks in Mac OS X and an x in Linux. Is there any common way to get the encrypted password of a user across POSIX systems?
Thanks, Roger
_______________________________________________Do not post admin requests to the list. They will be ignored.Darwin-dev mailing list (email@hidden)
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden