• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 234
  • Last Modified:

Linux Networking question

Hi !

For my university I need to setup a single Linux server for
email accounts. I don't need to have telnet or ftp accounts,
only email...

So what I need is : to add some user login and password into
a db (or gdbm file) to add news users for sendmail (this is
easy : I already done that.) and find a modified version of
a pop server to look at the db file for user accounts/password, not the /etc/passwd file.

  • 2
1 Solution
I have looked around a little for pop servers myself, and all the implementations I have seen have used account info from /etc/passwd. You could simply add user accounts to /etc/passwd, as you would normally, and change the shell for these users to /bin/true. This would prevent them from logging in, and as long as /bin/true is not listed in /etc/shells, they will be unable to use ftp access also. The ftpusers file can also be used to block ftp access.

Between this and sendmails /etc/aliases file, you should be able to do whatever you like with mail, while retaining security.

kiwi35Author Commented:
Yes, This like I use now, but to modify the /etc/passwd you must be root (or suid)... Because I don't want any root access on this machine when add/deleting users.

Also the machine will be a mail hub, so ftp access isn't a good idea since I don't want any additions to /etc/passwd...

Also I need speeeeeed : I have about 1000 users (in the next three month about 5000 users [not only univesity students]) so the main idea is use a fast database access..

The best idea of db/dbm file is :

  - you don't need to be root to modify it... For exeample
    a user staff or mailstaff can add / delete thoses mails
    account without root access...
  - db/dbm are fast access database... Since my database is going
    to be more and more big I need speed... (yes I know i can
    buy a new machine but I don't have any funds yet !)
  - there also a security issue since the accounts are not in
    /etc/passwd there is no way some user can log into this
  - I can managa also virtual domains better..

Also, the NIS solution is not good : NIS server down = no mail and NIS lookup are too slow...

The way I would set this up would take alittle bit of time and thought but here goes. Write some code similar to .htaccess file and set up a seperate password file. You will need to hack some of the kernel code to do this. After you have done this then you would set up some non-priveleged scripts to add users to this file.

After the user is added to the file this could then point to the mail functions you require.

The coding and kernel hacking for this would be quite extensive and unless you have the expertise yourself I would recommend getting a qualified programmer to do the code and kernel changes for you.

I haven't the time to write the code and the question would need  to be substantially more well rewarded for someone to do this. Try it yourself or get an expert to do it but I feel this woul;d be the only way that you will get what you require...


kiwi35Author Commented:
The solution proposed is mainly to change /etc/passwd to /usr/local/mail/passwd...

The main problem is the user/passwd are in text mode and has lots of problems :

 - it is slow... Imagine a lookup on 20000 users...
 - it is really unworkable, when you add or remove a user
   it can takes hours to find the correct login,
 - it is impossible to modify this database quickly (for example
   without shuting down the mail server...)

Then I don't see why I must hacking the kernel to solve this problem... Only the popper's sources should be enougth, isn't it ?

I can give the idea that I want to have all my user/passwd in a SQL server on the mail server... (it is fast and we don't need to have root access to add new data...).

The main idea of this project is : all user/passwd will be on one centralized database that don't depend of the Operating System !

The solution just moves the problem to another place but don't solve it... Remenber I need speed !!!!!! and only a db/dbm/gdbm file can give such speed !

Thanks again,
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now