Discussion:
[uClinux-dev] BOA webserver + login/password
Daniel
2006-02-20 16:33:52 UTC
Permalink
I'm looking for a way of implementing login/password for the BOA
webserver. I want to restrict access to the webpages to just some known
users. Does anyone know how to do this within BOA?

Thanks.
Martin Zielinski
2006-02-21 08:11:32 UTC
Permalink
Post by Daniel
I'm looking for a way of implementing login/password for the BOA
webserver. I want to restrict access to the webpages to just some known
users. Does anyone know how to do this within BOA?
Thanks.
_______________________________________________
uClinux-dev mailing list
uClinux-dev at uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev at uclinux.org
Long time ago, since i did this, but that's what i remember:

1. add a "char* account" to the request structure.

2. add a line like this to "process_option_line (...)":

else if (!memcmp(line, "CONTENT_LENGTH", 15) && !req->content_length)
req->content_length = value;
+ else if (!memcmp(line, "AUTHORIZATION", 13) && !req->account)
+ req->account = value + 6; /* "Authorization: Basic " */

3. add a authorization function to the code:

int is_authorized (request *req)
{
/* use req->account to test the authorization */
...
/* base64 encoded username%password */
}

4. add to process_header_end():

if (translate_uri(req) == 0) { /* unescape, parse uri */
SQUASH_KA(req);
return 0; /* failure, close down */
}

+ if (!is_authorized(req)) {
+ extern char *realm;
+ send_r_unauthorized(req, realm);
+ return 0;
+ }


----------------

My base-version is 0.94.12. I don't known, what improvements or changes
came in meanwhile.

Bye,

Martin
--
Martin Zielinski mz at seh.de
Software Development
SEH Computertechnik GmbH www.seh.de
Heiko Degenhardt
2006-02-21 09:27:46 UTC
Permalink
Post by Daniel
I'm looking for a way of implementing login/password for the BOA
webserver. I want to restrict access to the webpages to just some known
users. Does anyone know how to do this within BOA?
Some years ago I did that with the "Auth" directive in the boa.conf.
I'm not shure anymore what I had to do to get that working. But if
you need some help I can try to reproduce what I did.

Rgds.
Heiko.
Daniel
2006-02-22 09:23:32 UTC
Permalink
Post by Heiko Degenhardt
Post by Daniel
I'm looking for a way of implementing login/password for the BOA
webserver. I want to restrict access to the webpages to just some known
users. Does anyone know how to do this within BOA?
Some years ago I did that with the "Auth" directive in the boa.conf.
I'm not shure anymore what I had to do to get that working. But if
you need some help I can try to reproduce what I did.
Rgds.
Heiko.
Did you just add the Auth directive to boa.conf? What version did you
work with?

Thanks,

Daniel.
Sandro M
2006-02-22 15:41:27 UTC
Permalink
Hello Heiko,
I tried a bit of solution to get working the auth feature in boa,but I had not success.. :(
if u can try to reproduce what you did I will thanks a lot lot
I'm using Boa 0.93.15

Thanks in advance
Sandro
Post by Daniel
I'm looking for a way of implementing login/password for the BOA
webserver. I want to restrict access to the webpages to just some known
users. Does anyone know how to do this within BOA?
Some years ago I did that with the "Auth" directive in the boa.conf.
I'm not shure anymore what I had to do to get that working. But if
you need some help I can try to reproduce what I did.

Rgds.
Heiko.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.uclinux.org/pipermail/uclinux-dev/attachments/20060222/3164046e/attachment.html>
Dan Searle
2006-02-22 15:46:21 UTC
Permalink
Hi,

You probably want to write some CGI scripts which can do cookies and
session management using them, like php.

Dan...
Post by Sandro M
Hello Heiko,
I tried a bit of solution to get working the auth feature in boa,but I had not success.. :(
if u can try to reproduce what you did I will thanks a lot lot
I'm using Boa 0.93.15
Thanks in advance
Sandro
Post by Daniel
I'm looking for a way of implementing login/password for the BOA
webserver. I want to restrict access to the webpages to just some known
users. Does anyone know how to do this within BOA?
Some years ago I did that with the "Auth" directive in the boa.conf.
I'm not shure anymore what I had to do to get that working. But if
you need some help I can try to reproduce what I did.
Rgds.
Heiko.
This message has been scanned for viruses by MailController - www.MailController.altohiway.com
--

Dan Searle
Adelix Ltd
dan.searle at adelix.com web: www.adelix.com
tel: 0845 230 9590 / fax: 0845 230 9591 / support: 0845 230 9592
snail: The Old Post Office, Bristol Rd, Hambrook, Bristol BS16 1RY. UK.

Any views expressed in this email communication are those
of the individual sender, except where the sender specifically states
them to be the views of a member of Adelix Ltd. Adelix Ltd. does not
represent, warrant or guarantee that the integrity of this communication
has been maintained nor that the communication is free of errors or
interference.
Heiko Degenhardt
2006-02-27 13:24:13 UTC
Permalink
Hi Sandro, Daniel,
Post by Sandro M
I tried a bit of solution to get working the auth feature in boa,but I had not success.. :(
if u can try to reproduce what you did I will thanks a lot lot
I'm using Boa 0.93.15
I tried it again with Boa/0.93.15:
- On the pc (as root) I generated a crypt() encoded password:
/usr/sbin/htpasswd2 -dnb hede Test
hede:ktRQRgXYsWnf6
(the password is "Test")
- Then I added a line to the target's /etc/passwd:
hede:ktRQRgXYsWnf6:0:0:Web User::
- In target's /config/boa.conf I added a line:
Auth /test /etc/passwd
This will require an authorization for the directory /test of
boa (that is /home/httpd/test on the target in my case), and
will check the given password against the user's entry in
etc/passwd.
- Then I created the named directory and a simple index.html
therein.
- Now I restarted boa (by killing it's process id so that it was
restarted from the inittab)
- Then I directed my browser to http://192.168.0.1/test/. I was
prompted for user name and password and got auth'ed successfully.

HTH.
Rgds.
Heiko.
Sandro M
2006-02-28 11:21:18 UTC
Permalink
Hello Heiko,
you was right!! all work fine now!! I dont know how to thank u :)
My only mistake was that I didnt understand that /test was referring on Documentroot! so I putted
Auth /usr/httpd/cgi-bin/test instead of
Auth /test
What a fuss..
But now I've only a last question: if I use plain password using (on the PC):
/usr/sbin/htpasswd -dnbp hede Test
all goes right on the target,
but if I use encrypted password it seems that uClinux compares wrong the 2 password (the one in /etc/passwd and the one that the user insert)..maybe I need some de-encrypt binary from the uClinux-dist that I have omissed?

Thanks again you helped me a lot!
bye,
Sandro

Hieko Wrote:

Hi Sandro, Daniel,
Post by Sandro M
I tried a bit of solution to get working the auth feature in boa,but I had not success.. :(
if u can try to reproduce what you did I will thanks a lot lot
I'm using Boa 0.93.15
I tried it again with Boa/0.93.15:
- On the pc (as root) I generated a crypt() encoded password:
/usr/sbin/htpasswd2 -dnb hede Test
hede:ktRQRgXYsWnf6
(the password is "Test")
- Then I added a line to the target's /etc/passwd:
hede:ktRQRgXYsWnf6:0:0:Web User::
- In target's /config/boa.conf I added a line:
Auth /test /etc/passwd
This will require an authorization for the directory /test of
boa (that is /home/httpd/test on the target in my case), and
will check the given password against the user's entry in
etc/passwd.
- Then I created the named directory and a simple index.html
therein.
- Now I restarted boa (by killing it's process id so that it was
restarted from the inittab)
- Then I directed my browser to http://192.168.0.1/test/. I was
prompted for user name and password and got auth'ed successfully.

HTH.
Rgds.
Heiko.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.uclinux.org/pipermail/uclinux-dev/attachments/20060228/4e86d1f7/attachment.html>
Heiko Degenhardt
2006-02-28 12:16:11 UTC
Permalink
Hi Sandro,
Post by Sandro M
/usr/sbin/htpasswd -dnbp hede Test
you wouldn't need htpasswd then, imho.
Post by Sandro M
all goes right on the target,
but if I use encrypted password it seems that uClinux compares wrong the 2
password (the one in /etc/passwd and the one that the user
insert)..maybe I
Post by Sandro M
need some de-encrypt binary from the uClinux-dist that I have omissed?
Hm. Don't know why it works with plaintext passwords in your case.
Does /var/log/messages show anything from boa concerning that?

The only thing I noticed was:
If you look in the boa sources, auth.c:auth_check_userpass() you see
that the authfile given in the Auth directive of boa.conf is only
read if EMBED is _not_ defined. For the EMBED case getpwnam(3) is
used, that reads /etc/passwd for the password entry.
But the authfile you give in boa.conf has to exist anyway because it
is search for while boa reads the config. That's why I used the line
"Auth /test /etc/passwd" in my mail yesterday.

You can easily fix the boa source to use the authfile even if EMBED
is defined (that would be the cleaner solution, imho).
But that's imho not the reason why plaintext passwords work for you.

Rgds.
Heiko.
Daniel
2006-03-01 08:17:50 UTC
Permalink
Hi Sandro and Heiko.

auth.c is a file that is not usually found in any version of Boa. I
think there is a patch fo the 0.94.114rc19 version that adds basic
authentification but not for the version you work with. I'm working with
the 0.94.13 version and it doesn't accept the "Auth" directive in the
boa.conf file. Have you made the modifications described by Martin
Zielinski some days ago in this thread?

Daniel.
Post by Heiko Degenhardt
Hi Sandro,
Post by Sandro M
/usr/sbin/htpasswd -dnbp hede Test
you wouldn't need htpasswd then, imho.
Post by Sandro M
all goes right on the target,
but if I use encrypted password it seems that uClinux compares wrong the 2
password (the one in /etc/passwd and the one that the user
insert)..maybe I
Post by Sandro M
need some de-encrypt binary from the uClinux-dist that I have omissed?
Hm. Don't know why it works with plaintext passwords in your case.
Does /var/log/messages show anything from boa concerning that?
If you look in the boa sources, auth.c:auth_check_userpass() you see
that the authfile given in the Auth directive of boa.conf is only
read if EMBED is _not_ defined. For the EMBED case getpwnam(3) is
used, that reads /etc/passwd for the password entry.
But the authfile you give in boa.conf has to exist anyway because it
is search for while boa reads the config. That's why I used the line
"Auth /test /etc/passwd" in my mail yesterday.
You can easily fix the boa source to use the authfile even if EMBED
is defined (that would be the cleaner solution, imho).
But that's imho not the reason why plaintext passwords work for you.
Rgds.
Heiko.
Heiko Degenhardt
2006-03-01 09:47:41 UTC
Permalink
Hi Daniel,
Post by Daniel
auth.c is a file that is not usually found in any version of Boa. I
think there is a patch fo the 0.94.114rc19 version that adds basic
authentification but not for the version you work with. I'm working with
the 0.94.13 version and it doesn't accept the "Auth" directive in the
boa.conf file. Have you made the modifications described by Martin
Zielinski some days ago in this thread?
no. I only worked with the boa coming with the uClinux-dist (I think
at least uClinux-dist-20030226 and uClinux-dist-20040408.tar.gz).
That included the "Auth" stuff.

Rgds.
Heiko.
Sandro M
2006-03-03 07:37:34 UTC
Permalink
Hi Daniel,
I solved everything about the auth problem, a friend of mine commented a
line in auth.c (that I have already found with the uClinux-Dist
(/user/boa/src), like Heiko), I uncomment it and all goes right ;)
If you need help I'm here.

Bye,
Sandro
Post by Daniel
Hi Sandro and Heiko.
auth.c is a file that is not usually found in any version of Boa. I
think there is a patch fo the 0.94.114rc19 version that adds basic
authentification but not for the version you work with. I'm working with
the 0.94.13 version and it doesn't accept the "Auth" directive in the
boa.conf file. Have you made the modifications described by Martin
Zielinski some days ago in this thread?
Daniel.
Tom
2006-09-08 13:53:42 UTC
Permalink
Hi All,

Can you tell me why www.uclinux.org works so slowly? I tried to download patches but no success,
most of time I'm getting timeout. Even if I use proxies (to eliminate my location) result is the same.
For example
http://www.uclinux.org/pub/uClinux/uClinux-2.4.x/ - browsing this page takes about 3 minutes.

Also I'm not able to connect to cvs.uclinux.org repository because I'm getting time-out

I tried mailaman.uclinux.org and it works fine. For example:
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev - browsing this page only takes 10 seconds.

BRs,
Tom.
Francesco Lodi
2006-09-08 13:59:38 UTC
Permalink
Post by Tom
Hi All,
Can you tell me why www.uclinux.org works so slowly? I tried to download patches but no success,
most of time I'm getting timeout. Even if I use proxies (to eliminate my location) result is the same.
For example
http://www.uclinux.org/pub/uClinux/uClinux-2.4.x/ - browsing this page takes about 3 minutes.
I have the same problem too.
I searched the archive but did not find any maintenance advise for this
week...

Best regards,
Francesco Lodi
Jeremy Collake
2006-09-08 14:24:08 UTC
Permalink
Post by Francesco Lodi
Post by Tom
Hi All,
Can you tell me why www.uclinux.org works so slowly? I tried to download patches but no success,
most of time I'm getting timeout. Even if I use proxies (to eliminate my location) result is the same.
For example
http://www.uclinux.org/pub/uClinux/uClinux-2.4.x/ - browsing this page takes about 3 minutes.
I have the same problem too.
I searched the archive but did not find any maintenance advise for this
week...
Best regards,
Francesco Lodi
_______________________________________________
uClinux-dev mailing list
uClinux-dev at uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev at uclinux.org
Due to this problem, a friend of mine set up a torrent for
uclinux-dist-20060803.tar.gz:

http://linuxtracker.org/torrents-details.php?id=2823

It doesn't help you guys probably, but maybe will be useful to someone..
--
Jeremy Collake
Michael Durrant
2006-09-08 15:35:29 UTC
Permalink
To all...

Thanks to everyone that has expressed concerns
about connectivity related issues. At present
www.uclinux.org has once again achieved its
max simultaneous connections threshold. Yahoo!

But .. In review of the logs and active connections,
I found that a subnet of machines located in China
(that have no valid reverse lookups) has been chewing
up most of the available connections. Action is being
taken.

Regards,
Michael Durrant
mdurrant at uclinux.org
Post by Jeremy Collake
Post by Tom
Post by Tom
Hi All,
Can you tell me why www.uclinux.org works so slowly? I tried to
download patches but no success,
Post by Tom
most of time I'm getting timeout. Even if I use proxies (to
eliminate my location) result is the same.
Post by Tom
For example
http://www.uclinux.org/pub/uClinux/uClinux-2.4.x/ - browsing this
page takes about 3 minutes.
I have the same problem too.
I searched the archive but did not find any maintenance advise for this
week...
Best regards,
Francesco Lodi
_______________________________________________
uClinux-dev mailing list
uClinux-dev at uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev at uclinux.org
Due to this problem, a friend of mine set up a torrent for
http://linuxtracker.org/torrents-details.php?id=2823
It doesn't help you guys probably, but maybe will be useful to someone..
Tom
2006-09-08 16:15:32 UTC
Permalink
Post by Michael Durrant
To all...
Thanks to everyone that has expressed concerns about connectivity related issues. At present www.uclinux.org has once again
achieved its max simultaneous connections threshold. Yahoo!
But .. In review of the logs and active connections, I found that a subnet of machines located in China (that have no valid
reverse
Post by Michael Durrant
lookups) has been chewing up most of the available connections. Action is being taken.
Regards,
Michael Durrant
Hi Michael,

It helped! Now it opens normally. Thanks!

Tom.
Tom
2006-09-11 13:08:38 UTC
Permalink
Post by Tom
Post by Michael Durrant
To all...
Thanks to everyone that has expressed concerns about connectivity
related issues. At present www.uclinux.org has once again achieved its max simultaneous connections threshold. Yahoo!
But .. In review of the logs and active connections, I found that a
subnet of machines located in China (that have no valid reverse
lookups) has been chewing up most of the available connections. Action is being taken.
Regards,
Michael Durrant
Hi Michael,
It helped! Now it opens normally. Thanks!
Tom.
Does China domain flooded uclinux.org again? I'm not able to connect today to site with timeout response.
Tom
Michael Durrant
2006-09-11 16:58:52 UTC
Permalink
Tom,

No one geographic centre should be singled
our for todays slow downs. Popularity is
to blame. The volume of traffic this morning
was/is very large.

Regards,
Michael Durrant
Post by Tom
Post by Tom
Post by Michael Durrant
To all...
Thanks to everyone that has expressed concerns about connectivity
related issues. At present www.uclinux.org has once again achieved its max simultaneous connections threshold. Yahoo!
But .. In review of the logs and active connections, I found that a
subnet of machines located in China (that have no valid reverse
lookups) has been chewing up most of the available connections. Action is being taken.
Regards,
Michael Durrant
Hi Michael,
It helped! Now it opens normally. Thanks!
Tom.
Does China domain flooded uclinux.org again? I'm not able to connect today to site with timeout response.
Tom
_______________________________________________
uClinux-dev mailing list
uClinux-dev at uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev at uclinux.org
Loading...