LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 06-30-2006, 09:54 PM   #1
rickh
Senior Member
 
Registered: May 2004
Location: Albuquerque, NM USA
Distribution: Debian-Lenny/Sid 32/64 Desktop: Generic AMD64-EVGA 680i Laptop: Generic Intel SIS-AC97
Posts: 4,250

Rep: Reputation: 62
Final security checks setting up thttpd


I have thttpd up and running and everything seems to be working fine. It's only accessible from behind my firewall now, but it is definitely a breeze to get working. I have been following this setup guide which is done using NetBSD as the OS.

Things didn't happen exactly the same way installing on Debian, but I was able to follow exactly what was happening differently at each step along the way until the final security check. I think the chroot is working correctly, but I'd like to be able to duplicate this (fstat) command.

From the article:
Quote:
...tell the daemon to chroot itself into the documents' root directory after startup. This is easy to do on NetBSD by passing the -r flag to the daemon. With this in mind, modify /etc/rc.conf:

# cat >>/etc/rc.conf
echo thttpd=YES
echo thttpd_flags=-r
^D
The rc.conf function seems to be handled in Debian by /etc/init.d/thttp.d ... but all it does is start the server. The chroot is apparently handled in /etc/thttpd/thttp.conf file with the single command "chroot."

Back to the article:
Quote:
...make sure that the -r flag was effective ... with help from the fstat command, whose purpose is to show the status of all open files. Search for the root file used by the daemon:

# fstat | grep ^thttpd | grep root
thttpd thttpd 1206 root /home 2351520 drwxrwxr-x 512 r

What the output shows is that the command is being executed under the directory pointed to by the 2351520 inode, living under the /home filesystem (which is a separate partition).
For me, that command returns, "bash: fstat: command not found"

Interestingly, "man fstat" returns information on a "stat" command which seems to include fstat, but I can't figure out how to make it work. "aptitude install fstat" doesn't find the program.
 
Old 07-01-2006, 04:21 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Use "stat". If you would do "stat /" you'd see the inode for "/" aka "root" is 2. In a chroot it can't be. Also check out the code example and comments in http://www.linuxquestions.org/questi....php?p=2167284
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
thttpd and Apache shobalk Linux - Software 0 05-09-2006 09:35 AM
security checks (howto)? carboncopy Linux - Security 4 01-08-2005 08:00 AM
Thttpd for graphics server SupaDucta Linux - Software 3 11-15-2004 05:51 PM
Security checks and CPU usage Ion Silverbolt Linux - Security 1 10-17-2004 07:47 AM
PHP Form Security Checks pnh73 Programming 3 10-30-2003 01:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 03:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration