Allow user A to view user B's files


#1

Hi. I’ve got an FTP question.
Say I have example.com and access its files using my own FTP login. There is example.com/folder/ which I give access to another FTP user. When I am logged into FTP using my login, I cannot see files in example.com/folder/ that were uploaded by the other FTP user. Basically, how I can I view those files while logged into my FTP account instead of having to use the other login?

The reason why I ask is because I want to have an uploads folder where people can upload their files to it and I want to move those files people upload to other folders on the domain, but since I can’t see those files when I’m logged in using my account and because the other account is locked to that one folder, I’m stuck.

Any help would be appreciated. Thanks!


#2

You can change the permissions of the files and folders as you wish. You’ll need to log in to your server and change them accordingly. If you’re not familiar with permissions see this guide:
http://www.library.yale.edu/~lso/workstation/docs/permissions/


#3

Hi. I tried chmodding the shared folder to 775 on both users and I still can’t see files on one account that were uploaded by the other. Am I doing something wrong?


#4

I just solved this problem (if I understand it correctly) for my own site.

In my case, both users had been assigned the same group, and I imagine that would be true for you, too.

  1. I temporarily made my “other” user into a shell user (control panel/Users/Manage Users – Edit the FTP user),

  2. logged in as “other user” and added group privileges to the permissions on the folder I wanted people to use for uploading.

  3. I then made a symbolic link “ln -s ftp_folder /home/me/my_new_folder”.

  4. Now, logged in as me in my home directory, I see the ftp folder as my_new_folder. As me, I belong to the same group as “other user” and I have the privileges I assigned in step 2.

  5. Finally, I used the control panel to edit “other user” back into being just a ftp user.

So now, when someone ftp’s files as “other user”, I can treat them simply as my own files and copy or move them as I will.


#5

Hi. I tried making a symbolic link in shell but I got “permission denied.”

What permissions does the folder need to be?

I actually have a remapped subdirectory for this. Is this the same as symbolic link? This makes it so that files uploaded to subdomain.domain.com/folder can be accessed from domain.com/folder, which is how I want it. The only prob is that I can’t see files uploaded to subdomain.domain.com/folder because they were uploaded by the “other” user.

Perhaps remapping subdirs is only for HTTP and not FTP. But either way, I still can’t access files upped by “other” user to subdomain.domain.com/folder from my main FTP account.


#6

Sorry, I mis-stated the order I did things, which would account for your “Permission denied” error :frowning:

Here’s the sequence, corrected (I hope):

[color=#CC0000]1. I temporarily made my “other” user into a shell user (control panel/Users/Manage Users – Edit the FTP user),

  1. logged in as “other user” and added group privileges to the permissions on the folder I wanted people to use for uploading. Call it ftp_folder. [/color]

The “ls -l” listing for ftp_folder should now look like drwxrwx… where the last three elements are whatever they were beforehand.

[color=#CC0000]3. logged back in as “me” (note: “my_new_folder” does not yet exist.)

  1. I then made a symbolic link “ln -s /home/other_user/ftp_folder my_new_folder”. This creates “my_new_folder”, which is really just a view onto /home/other_user/ftp_folder.
    [/color]
    Now I see the ftp folder as my_new_folder. As me, I belong to the same group as “other user” and I have the privileges I assigned in step 2. [color=#0000CC]Step 4 (3 in my previous message) would fail with “Permission denied” when logged in as “other_user” because “other_user” probably would not have write privileges in the “me” home directory.[/color]
    [color=#CC0000]
  2. Finally, I used the control panel to edit “other user” back into being just a ftp user.
    [/color]

I hope I got it right this time. And I hope that for you, “me” and “other_user” are in the same group. You can check, using the shell command “groups”.


#7

Great! Seems to work but my problem right now is that I can’t seem to see “my_new_folder” in FTP. I can only see it via shell. Any ideas?


#8

No. When I use “Fetch” (GUI Mac FTP client) I see my_new_folder as an alias, but if I click on it, it just thinks it’s supposed to download the (alias) file.

I guess a workaround is to use the shell, interactively or by script, and copy the contents of “my_new_folder” to some other normal folder within your site structure.

You probably saw this thread, which explains why you can’t do it simply using ftp with a remapped subdirectory. The simple answer given there is that ftp can’t range outside the tree rooted in its main directory.


#9

I see… Well I don’t use shell to manage my site because I’m not familiar with shell commands. I guess there’s no other option besides shell in this case though?

(Thanks a lot for your help, by the way.)