Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2001-10

Login CGI

11 messages · 6 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Anderson

Hi, forgives for my English, and would like to know as I can make one login of a user way cgi.

I use a Linux Mandrake 8.0

Tanks

---

Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.282 / Virus Database: 150 - Release Date: 25/09/01

Reply by email

Andreas K. Foerster
to Anderson
Anderson wrote
Hi, forgives for my English, and would like to know as I can make one login of a user way cgi. I use a Linux Mandrake 8.0

Sorry, but i don't understand, what you want.

Do you want to login into a console?
Then you don't need to make a cgi program,
then you can simply start a telnet: <telnet://machine.name>

Or do you want to do something with the privileges of a special user?

Please itry to explain a bit more exactly what you want.

Tschuess Andreas

Reply by email

Anderson
to Andreas K. Foerster

A Simple cgi for authenticate a linux user eg.: root in the web ;o)

Earlier message 38 lines
----- Original Message ----- From: Andreas K. Foerster To: Sent: Monday, October 15, 2001 3:03 PM Subject: Re: [fpc-pascal]Login CGI > On Mon, Oct 15, 2001 at 11:49:22AM -0300, Anderson wrote: > > > Hi, forgives for my English, and would like to know as I > > can make one login of a user way cgi. > > > > I use a Linux Mandrake 8.0 > > Sorry, but i don't understand, what you want. > > Do you want to login into a console? > Then you don't need to make a cgi program, > then you can simply start a telnet: <telnet://machine.name> > > Or do you want to do something with the privileges of a special user? > > Please itry to explain a bit more exactly what you want. > > -- > Tschuess > Andreas > > _______________________________________________ > fpc-pascal maillist - > http://lists.freepascal.org/mailman/listinfo/fpc-pascal > --- Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.282 / Virus Database: 150 - Release Date: 25/09/01

Reply by email

Andreas K. Foerster
to Anderson
Anderson wrote
A Simple cgi for authenticate a linux user eg.: root in the web ;o)

If you want to have root privileges, simply make the CGI program setuid root.
But don't blame me, if someone kills your system!

Or what do you want - I still don't understand.

Tschuess Andreas

Reply by email

Cyril Lamy
to Andreas K. Foerster
If you want to have root privileges, simply make the CGI program setuid root. But don't blame me, if someone kills your system!

It is very dangerous to run a cgi script as root.
any hole in the cgi can be an enty point to break your system

I recently made an web-interface to create unix accounts on a server : You have a form that require a the username and a password to create the corresponding account.
This page is protected by a .htaccess (the server is running apache).

When you validate the form, the cgi create a file containing the username and the plain password. (not
very sure, of course but more secure than running cgi as root). Then , the cron daemon execute all ten minutes a program that have the setuid set to root and this program
read the file created by the cgi, verify datas and then create unix accounts.

This method is not 100%secure but it shows you how to avoid cgi running as root.

Reply by email

Cabuzel Thierry
Show quoted text 16 lines
-----Original Message----- From: Andreas K. Foerster Sent: mardi 16 octobre 2001 14:25 To: Subject: Re: [fpc-pascal]Login CGI On Mon, Oct 15, 2001 at 04:54:46PM -0300, Anderson wrote: > A Simple cgi for authenticate a linux user eg.: root in the web ;o) If you want to have root privileges, simply make the CGI program setuid root. But don't blame me, if someone kills your system! Or what do you want - I still don't understand.

Perhaps, he want a CGI that verify if the couple User/Password entered in a html form is a valid linux User/Password as defined in his etc/passwd on his box.

Show quoted text 9 lines
-- Tschuess Andreas _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email

LUKACS-SINGER Peter
to Cyril Lamy: It is very dangerous to run a cgi script as root. any hole in the cgi can be an enty…
Cyril Lamy wrote
When you validate the form, the cgi create a file containing the username and the plain password. (not very sure, of course but more secure than running cgi as root).

If you do this, you might want to have your CGI script encode the password given so no plain passwords will be stored. When the ten-minutely script runs, it will place the appropiate line containing the username and the already encoded password into the shadow password file (be aware to use some kind of locking mechanism while editing the shadow file)

ave
lsp

Reply by email

Kako - Freemail
to Cabuzel Thierry: Perhaps, he want a CGI that verify if the couple User/Password entered in a html form is…
> > A Simple cgi for authenticate a linux user eg.: root in the web ;o) > > If you want to have root privileges, simply make the CGI program > setuid root.

Is a good idea to run a CGI with root privileges?
By myself use the standard HTTP authentication method instead of CGI! Where do you want use it? If not in an intranet, I suggest use SSL with HTTP auth method!

bye
kako

Reply by email

Anderson
to Kako - Freemail

How to make this authentication in linux, please send me a exemple...

[]´s

Anderson

Earlier message 33 lines
----- Original Message ----- From: Kako - Freemail To: Sent: Tuesday, October 16, 2001 10:46 AM Subject: Re: [fpc-pascal]Login CGI > > > > > A Simple cgi for authenticate a linux user eg.: root in the web ;o) > > > > > > If you want to have root privileges, simply make the CGI program > > > setuid root. > > Is a good idea to run a CGI with root privileges? > By myself use the standard HTTP authentication method instead of CGI! > Where do you want use it? If not in an intranet, I suggest use SSL with HTTP > auth method! > > bye > kako > > > _______________________________________________ > fpc-pascal maillist - > http://lists.freepascal.org/mailman/listinfo/fpc-pascal > --- Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.282 / Virus Database: 150 - Release Date: 25/09/01

Reply by email

Andreas K. Foerster
to Cyril Lamy: It is very dangerous to run a cgi script as root. any hole in the cgi can be an enty…
Cyril Lamy wrote 6 lines
> If you want to have root privileges, simply make the CGI program > setuid root. > But don't blame me, if someone kills your system! It is very dangerous to run a cgi script as root. any hole in the cgi can be an enty point to break your system

I just forgot the smiley.

Show quoted text 8 lines
I recently made an web-interface to create unix accounts on a server : You have a form that require a the username and a password to create the corresponding account. This page is protected by a .htaccess (the server is running apache). When you validate the form, the cgi create a file containing the username and the plain password. (not very sure, of course but more secure than running cgi as root).

You could make it more secure when you make this:
chmod('filename', 0);
Then only root can read the file.

Show quoted text 7 lines
Then , the cron daemon execute all ten minutes a program that have the setuid set to root and this program read the file created by the cgi, verify datas and then create unix accounts. This method is not 100%secure but it shows you how to avoid cgi running as root.

Very good idea.
Thanks!

Tschuess Andreas

Reply by email