O'Reilly logo

Web Security and Commerce by Gene Spafford, Simson Garfinkel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

A Simple User Management System

In this example, we will present a simple web-based user account management system. This system consists of the following parts:

  • A user authorization file that lists the authorized users. In this example, the file is kept in /etc/users.simple.

  • A directory that contains documents that the authorized users are allowed to access. In this example, the directory is /usr/local/etc/httpd/htdocs/simple. The matching URL for the directory is http://www.ex.com/simple.

  • A directory that contains the CGI scripts that are used to manage the user accounts. In this example, the directory is /usr/local/etc/httpd/cgi-bin/simple. The matching URL for this directory is http://www.ex.com/cgi-bin/simple.

  • A script that adds new users to the system. It can only be run by the user administrator.

  • A script that allows users to change their passwords.

One problem with simple password-based authentication on many web servers is that the password file must be readable by the web server’s effective UID. Most site administrators have solved this problem by making the password file world-readable, which obviously leads to problems if anyone other than the system administrator has or can get access to the computer. A better approach is to set the file permissions on the password file so that it can only be read by the web server users or group, as we do here.

The next section contains step-by-step instructions for setting up this system on a computer running the UNIX operating system with ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required