ProFTP chrooting user to /home/{user}?

Hello,

I have a folder set up called /web. In that I have /web/{user}, then domain names and various folders for each domain. In the /home directory for each user, I want a symlink called "web" that points to /web/{user}. So for example, for user "joe", there is

/web/joe/joes.org etc. and

/home/joe

and /home/joe/web points to /web/joe

This is all fine and good, but when joe logs in via ftp, she is put in her home directory, but the listing says she's in / (and not /home/joe). So if she trys to go to her symlink "web" pointing to /web/joe, the ftp client says it's "too many levels of symbolic links" since I think it's trying to use /web to get to /web/joe which obviously would be wrong.

Is proftpd server chrooting joe to her home dir? Can I change this behaviour in the config? Through webmin? I did some googling, but couldn't find anything helpful.

Thanks in advance,

Phillip

2 Replies

Instead of symlinks, you can bind-mount the /web/joe directory into their home dir:

# run these once
mkdir /home/joe/web
chown joe: /home/joe/web

# run this at boot, or mabye fstab entry ??
mount -o bind /web/joe /home/joe/web

Kind of odd, but this is what I found while googling..

http://proftpd.linux.co.uk/localsite/Us … links.html">http://proftpd.linux.co.uk/localsite/Userguide/linked/chroot-symlinks.html

-Chris

@caker:

Instead of symlinks, you can bind-mount the /web/joe directory into their home dir:
Just a general warning to anyone doing bind mounts (probably not a problem in this case, but…); they can not be done read-only. I wanted to chroot my web server but allow CGI scripts (perl, shell), thus requiring /lib and stuff. So I was going to bind-mount /lib into the chrooted area, so any patches applied to the system would automatically appear in the chroot area. Unfortunately the "ro" option is ignored. I definitely don't want my real /lib to be rw in the chroot area!

So… bind mounts good for rw access; bad for ro access.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct