I have been trying to chroot my FTP accounts so that,
To this end, I have used this article on chrooting ftp accounts, but I have run into an issue with some of the instructions at the very end.
Some background info:
My problem comes with the second to last code box at the bottom of the article that I referenced above. The description goes as such:
Problem is, for me the information here is inadequate. Do I create a file /tmp/passwd and put into it the code in the first half of the quoted code above? If so, the very next terminal command (
Any help would be greatly appreciated.
- they are unique to the web site they are meant to service, even though I own and control both the iron and the sites
- their base directories are the root of the corresponding web site.
To this end, I have used this article on chrooting ftp accounts, but I have run into an issue with some of the instructions at the very end.
Some background info:
- The base ftpchroot directory is /var/www.
- The FTP username for each site is its whole URL (http://www.domain.com).
- The home directory is a bit more complicated: /var/www/./domain/com/www (essentially, domain/tld/subdomain, to allow multiple subdomains under complimentary TLDs).
- I am running FreeBSD 10-RELEASE with Apache 2.4
My problem comes with the second to last code box at the bottom of the article that I referenced above. The description goes as such:
Create a dummy passwd file for all ftpchroot users and generate a passwd database from it and copy over the system group file to the chroot etc
Code:while IFS=: read user x uid gid x; do if [ "$gid" = "15" ]; then echo $user:*:$uid:$gid:::::: >> /tmp/passwd fi done < /etc/passwd pwd_mkdb -d /usr/local/ftpchroot/etc /tmp/passwd rm /usr/local/etc/ftpchroot/etc/master.passwd rm /usr/local/etc/ftpchroot/etc/spwd.db cp /etc/group /usr/local/etc/ftpchroot/etc chmod 555 /usr/local/etc/ftpchroot/etc chmod 444 /usr/local/etc/ftpchroot/etc/*
Problem is, for me the information here is inadequate. Do I create a file /tmp/passwd and put into it the code in the first half of the quoted code above? If so, the very next terminal command (
pwd_mkdb
) fails with
Code:
pwd_mkdb: /tmp/passwd: Inappropriate file type or format
Any help would be greatly appreciated.