Re: AUTHENTICATION IN UNIX
- From: Pascal Bourguignon <pjb@xxxxxxxxxxxxxxxxx>
- Date: Thu, 26 Oct 2006 18:31:25 +0200
sethukr@xxxxxxxxx writes:
Hi all,
I have implemented a sample FTP Server.
But it allows any user.
I need to implement a "Authendication Module" in my FTP Server( in
C lang).
Help me by giving ur suggestions. How can i authenticate a valid
user?????????????
The first question to answer, is what authentication database you want
to use.
For example, you could keep a list of user/password specific to your
ftp server, or you could use /etc/passwd, or you could use NIS or PAM
or LDAP, etc).
The second question is how the authentication protocol works. The
standard FTP just sends the user name and the password in clear to the
server, but this allow anybody with access to the network to listen
and collect the password. In some protocols, for example POP-3,
instead of sending the password in clear, we can send a md5 hash of
the user name + password + a token send by the server.
In any case, the server just needs to be able to find a password given
a user name, and then to do the processing it needs to do to authenticate.
If you keep your user/password in a simple file (or a db file), you
can just compare a password sent in clear with the password found in
the database.
If you want to use /etc/passwd(/etc/shadow), you need to encrypt the
password send it clear with the same salt as in
/etc/passwd(/etc/shadow), and compare the encrypted versions.
--
__Pascal Bourguignon__ http://www.informatimago.com/
HEALTH WARNING: Care should be taken when lifting this product,
since its mass, and thus its weight, is dependent on its velocity
relative to the user.
.
- Follow-Ups:
- Re: AUTHENTICATION IN UNIX
- From: sethukr
- Re: AUTHENTICATION IN UNIX
- From: sillybanter
- Re: AUTHENTICATION IN UNIX
- References:
- AUTHENTICATION IN UNIX
- From: sethukr
- AUTHENTICATION IN UNIX
- Prev by Date: AUTHENTICATION IN UNIX
- Next by Date: Re: AUTHENTICATION IN UNIX
- Previous by thread: AUTHENTICATION IN UNIX
- Next by thread: Re: AUTHENTICATION IN UNIX
- Index(es):
Relevant Pages
|