Results 1 to 5 of 5
OK, This has been kicking my ass. here is the lowdown.
I have an existing ftp server I want to transfer to a SFTP server, but I cannot figure out ...
- 09-08-2011 #1Just Joined!
- Join Date
- Dec 2010
- Posts
- 2
SFTP, Chroot and jailing users
OK, This has been kicking my ass. here is the lowdown.
I have an existing ftp server I want to transfer to a SFTP server, but I cannot figure out how to chroot users. I have read every
tutorial, and cannot apply those concepts to what I need.
Here is how my server is set up.
- FTP files are stored on a mounted harddrive
- Every folder was created prior to users (data dump from old windows box) & users were made to correspond with folders
- 35+ users. All with login, but no home directories.
I have 2 options as I see it. Either figure out how to prevent users from leaving the directories I have already created (part that's killing me). Or, dump the users list, start all over having each added user make a home directory and then dump the necessary folders into each home directory.
** oh yea, I think I need to mount the drive with a only read permissions for users. I tried umasking this, but could not login under any user.
Either way, I need help with chroot, and I am utterly confused.
Thanks in advance.
- 09-08-2011 #2
Have you GOOGLE'd for your answer? I see a lot of hits with howto chroot sftp.
You didn't say what version of linux you are using.
- 09-08-2011 #3Just Joined!
- Join Date
- Dec 2010
- Posts
- 2
As I said, I have gone over every tutorial there is. I am running CentOS. I believe the root of my problem is where my data is stored. I have everything mounted via fstab on a secondary drive. I believe that since my drive is mounted owned by root, I cannot change ownership of any of the sub directories to the users. Once I overcome this problem the rest will fall into line. I just don't know what to Google for that.
- 09-09-2011 #4Linux Guru
- Join Date
- Nov 2007
- Posts
- 1,695
This may help.
No one here knows what you have done, what "errors" you saw, or what steps you took after that. By spelling out "I did X because I thought this should work this way," someone else can find the flaws in your logic/assumptions/understanding of how things are/should be working.
SFTP is tied into the SSH server, so yes, the user has to have an account in /etc/passwd and their home directory can be changed to wherever the data is located. These users will need permission to access the data location. If the data is on a filesystem (such as NTFS, FAT, etc.) that doesn't supoort Linux permissions, you may/may not be able to work around that without moving the data and reformatting.
- 09-09-2011 #5
Have your tried to chown on the users subdirectories?


Reply With Quote