Changing FTP home directory/provide write access to /volume1

Questions reguarding modifying the FTP system may go here
Forum rules
Please note the disclaimer before modifying your Synology Product.

Changing FTP home directory/provide write access to /volume1

Postby smillard » Tue Feb 19, 2008 10:26 pm

I looked around on the forums and couldn't find any exact answer for this, it seems pretty simple.
I've enabled telnet and am relatively familiar with linux. I'd appareciate any definite answers on this subject - please refrain from "search the forums", because i've already spent 2 hours doing so.

I need the ability to allow FTP users to either

1) Write to the /volume1 directory
2) Change their home directory so by default when they log in the can upload
files.


A FTP client (that I dont control) cannot change directories, it only logs
in an uploads a file. With the current setup it will not work.
smillard
I'm New!
I'm New!
 
Posts: 4
Joined: Mon Mar 26, 2007 8:35 pm

Re: Changing FTP home directory/provide write access to /volume1

Postby rockyng » Sun Mar 02, 2008 4:58 am

I am using an IP-cam that can not change directory after login ftp.
I have been finding for solution over one year but in vain. Forget that.

smillard wrote:I looked around on the forums and couldn't find any exact answer for this, it seems pretty simple.
I've enabled telnet and am relatively familiar with linux. I'd appareciate any definite answers on this subject .....................................
.................A FTP client (that I dont control) cannot change directories, it only logs
in an uploads a file. With the current setup it will not work.
User avatar
rockyng
Beginner
Beginner
 
Posts: 27
Joined: Wed Jul 11, 2007 10:12 am
Location: Hong Kong

Re: Changing FTP home directory/provide write access to /volume1

Postby rockyng » Sat Jun 07, 2008 11:46 am

I don't know why the development team is reluctant to work on this issue.
I think it will not take a long time on coding for allowing ftp home configuration.

It is very common for user to feeding ipcam image to NAS. It has been a know problem for long time, but no one case.



smillard wrote:I looked around on the forums and couldn't find any exact answer for this, it seems pretty simple.
I've enabled telnet and am relatively familiar with linux. I'd appareciate any definite answers on this subject - please refrain from "search the forums", because i've already spent 2 hours doing so.

I need the ability to allow FTP users to either

1) Write to the /volume1 directory
2) Change their home directory so by default when they log in the can upload
files.


A FTP client (that I dont control) cannot change directories, it only logs
in an uploads a file. With the current setup it will not work.
User avatar
rockyng
Beginner
Beginner
 
Posts: 27
Joined: Wed Jul 11, 2007 10:12 am
Location: Hong Kong

Re: Changing FTP home directory/provide write access to /volume1

Postby rdhoore108 » Mon Mar 22, 2010 2:11 am

I found a way to map different (selected) users' home folders to one shared folder, so that when they log in, they all arrive in that shared folder instead of in their own home folder.

Note:
    For this to work, the ftp users should not require any own home folder, because you will need to delete it, and replace it with a link to the shared folder.
    You will need SSH or telnet access to the Synology DS, as well as the usual access to the web management interface.
    Whenever you do a firmware upgrade, you might have to redo this particular configuration
    Some specific manual configuration through the web management interface may also interfere with the proper operation of it, and you might need to do some manual resetting of access rights through SSH.

Therefore, this is not exactly for the faint of heart. But we've been using it for some weeks to our full satisfaction. It's a pity this is not part of the FTP web configuration, as it certainly is not rocket science.

Anyway, if anyone is interested, I'll make some time to write a "how to" in detail.
rdhoore108
Trainee
Trainee
 
Posts: 18
Joined: Thu Jan 21, 2010 8:58 pm

Re: Changing FTP home directory/provide write access to /vol

Postby rdhoore108 » Fri May 27, 2011 3:35 pm

Disclaimer: I am absolutely not responsible for whatever goes wrong in your life or other peoples lives, not before and not after you decide to do anything that is described here in this post.
Anyway, if anyone is interested, I'll make some time to write a "how to" in detail.


I received a request through PM to explain how to do this. Please read first the entire post before you execute any commands written here.

Let's say among our users we have Joe and Bill, and we want them all to see the root of the same share called "FTP" when they log in through FTP. They do not need their own Home folder, and they confirmed that we can happily erase it.

[In your own application, you will need to use the names of your users instead of "Bill" and "Joe", and the name of your desired home share instead of "FTP", but I guess that is obvious. :)]

In the DSM:

First make sure the users Joe and Bill have at least read rights on the FTP share.

Control Panel > FTP > Security settings:
Enable "Change the selected users' root to user home",
and click "Select User" to select Joe and Bill. Then click "Finish" and "OK".

So, now when they will log in through FTP, they should arrive in their own home folder.

The next step is to delete their home folder, and create a "symbolic link" (a kind of shortcut) to the share "FTP" instead.

Through ssh:

Code: Select all
rm -r -f /volume1/homes/Joe
rm -r -f /volume1/homes/Bill
ln -s /volume1/FTP /volume1/homes/Joe
ln -s /volume1/FTP /volume1/homes/Bill


So the first two commands remove the home directory of each of the above mentioned users (you need to be absolutely sure there is nothing in there that they would want to keep).
The last two commands create a new symbolic link instead (with the same name) to the share "FTP".

As this is done on the Linux level, none of the services have any clue that the home folder is not really the home folder any longer, but rather a redirection to another share.

(I guess you could also create a link to a sub-folder instead, within FTP. I haven't tried that, so I am not sure if they will be able to move up to the root of the share.)

I have found that this change persists through most firmware upgrades, but that you may need to do the first step - selecting the users in the DSM - again, or at least open that screen and then click "Finish" to confirm them once more. If not, they might again see all shares that they have rights for, instead of the intended share only.

If you ever want to undo this manual change, it is enough to delete the users, and their associated symbolic links will automatically get removed as well (as the DSM thinks it is deleting their home folders).
rdhoore108
Trainee
Trainee
 
Posts: 18
Joined: Thu Jan 21, 2010 8:58 pm

Re: Changing FTP home directory/provide write access to /vol

Postby chrisjako » Tue Aug 23, 2011 7:41 pm

I have set permissions and followed your commands but am getting this error

Code: Select all
Netstore> rm -r -f /volume1/homes/ukoffroaders
rm: can't remove '/volume1/homes/ukoffroaders': Permission denied


Please help I desperatley need to get this feature working!
chrisjako
I'm New!
I'm New!
 
Posts: 4
Joined: Mon Aug 22, 2011 7:31 pm

Re: Changing FTP home directory/provide write access to /vol

Postby chrisjako » Tue Aug 23, 2011 8:31 pm

o.k answered my own question by logging in as root with same admin password i managed to complete the above steps and after much fiddling with folder setups and privileges I managed to get it working deep into a folder structure i had created for websites

would be nice if this feature was added for simplicitys sake to the next release
chrisjako
I'm New!
I'm New!
 
Posts: 4
Joined: Mon Aug 22, 2011 7:31 pm


Return to FTP Mods

Who is online

Users browsing this forum: No registered users and 0 guests