• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

FBSD permissions & more!

TheOmegaCode

Platinum Member
I'm having some trouble trying to set up permissions. I've never really used permissions, other than the occasional file, so this is new to me. I've read the manpage on CHMOD as well as the FBSD Manual page on Permissions but they haven't really cleared anything up for me. Maybee it's just to damn early for me to be reading...

My work wants me and another intern to setup a web server. That part is easy. Now they want user specific folders underneath the webroot. It would look like this, /usr/local/www/data/%username%. The goal is for %username% to be able to upload to their own folder so they can essentially have their own website. Right now this is just a pilot project so it looks like http://127.0.0.1/%username%. The problem, for me, comes in when I was asked to do yet another thing. They want these users to be able to ftp into their home directory and only see their home directory. So they are to have rwx in data/%username% but --- in everything else. I spent a few hours configuring my box, and I'd really like it if I don't lock myself out. So I figured I'd ask questions before I tinkered.

I'm also going to be reading up on quotas and an easier way to create 50 some odd users in one fell swoop. So any help would be greatly appreciated.
 
So you want to be able to ftp to the server, by default it puts you in your home directory but not chrooted. If you create a symlink from /usr/local/www/data/username to ~/wwwdata or something that might be good enough. Take a way x permissions from /usr/home and they won't be able to chdir to /usr/home and see the other home dirs.

I think I had wu-ftpd set up to chroot people in a certain group to their home dir at one point, although it wasn't the most obvious thing to figure out and I wouldn't recommend wu-ftpd anyway.
 
I have the users pointed so that when they ftp in, they are automatically taken to their web folder by default. I need to make it so they cannot move from that directory. I don't want them to be able to [cd ..]. I just want them to stay in their directory and not be able to budge...
 
After much deliberation I got an answer...

awk -F: '$3 > 100 { print $1 }' /etc/passwd | sort +1 2>&1 | tee /etc/ftpchroot

This is especially nice for what I'm doing. Since I have a list of about 50 users, they all get put in /etc/ftpchroot.
 
Back
Top