Change FTP Home Directory?

Change FTP Home Directory?

Posted by: ffskyrider
Posted on: 2008-11-27 01:07:00

It seems that the current default home directory is /home/username/ . Is there a way for me to change this? Like /home/website/team/username or something?

Regards,
Skyrider

Re: Change FTP Home Directory?

Posted by: sXi
Posted on: 2008-11-27 04:14:00

If you mean when logging in via ftp, you should be able to change the settings in your ftp client.




How To Install PHP.INI / ionCube on DreamHost

Re: Change FTP Home Directory?

Posted by: ffskyrider
Posted on: 2008-11-27 04:26:00

I want when the user logs in through FTP, that he goes to the specific folder that I gave him access to, in this case it would be:

/home/domain/team/hisusername

And only there he has access to upload files to.

Re: Change FTP Home Directory?

Posted by: sXi
Posted on: 2008-11-27 07:37:00

Nearest easy way to setup that would be:

- Setup the new user account.

- Login and remove all files and folders.

- Create a directory called 'upload'.

- Panel > Domains > ReMap Sub-Directory.


Fully-hosted URL to remap: domain.com/team/hisusername

New path on [server]: home/user/upload




How To Install PHP.INI / ionCube on DreamHost

Re: Change FTP Home Directory?

Posted by: ffskyrider
Posted on: 2008-11-27 08:39:00

Thanks I'll try that.
Edited by ffskyrider on 11/27/08 08:41 AM (server time).

Re: Change FTP Home Directory?

Posted by: ffskyrider
Posted on: 2008-11-27 10:51:00

That seems to work fine! Thanks! But, how do I view the files of other people if they upload it before the upload folder?


EDIT: Found a way by using SFTP and then rename my username in the ftp /home/username to the username of the person. But when I attempt to remove a file, I'm getting:

Command: rm "/home/esf_damaera/upload/filhere"
Error: rm /home/esf_damaera/upload/filehere: permission deniedEdited by ffskyrider on 11/27/08 10:56 AM (server time).

Re: Change FTP Home Directory?

Posted by: sXi
Posted on: 2008-11-27 10:56:00

You'd need to have accounts with SFTP access and create symbolic links to each team user's home directory in a "main admin" account so you can browse them via your admin ftp login.




How To Install PHP.INI / ionCube on DreamHost

Re: Change FTP Home Directory?

Posted by: ffskyrider
Posted on: 2008-11-27 10:58:00

As I edited my post above:

EDIT: Found a way by using SFTP and then rename my username in the ftp /home/username to the username of the person. But when I attempt to remove a file, I'm getting:

Command: rm "/home/esf_damaera/upload/filhere"
Error: rm /home/esf_damaera/upload/filehere: permission denied

PS, how do I create those symbolic links?
Edited by ffskyrider on 11/27/08 10:59 AM (server time).

Re: Change FTP Home Directory?

Posted by: sXi
Posted on: 2008-11-27 20:29:00

As the uploading user is the owner of the file, your 'admin' user will have readonly access. If you want to take control of all files you'll need to setup Unix Groups and chown the user's files to the 'admin' user. This could be automated via a script/crontab.

To create a symbolic link in shell:

$ ln -s /home/someuser/ mylinkname


What is it that you're trying to accomplish?




How To Install PHP.INI / ionCube on DreamHost

Re: Change FTP Home Directory?

Posted by: ffskyrider
Posted on: 2008-11-28 05:00:00

In reply to:


What is it that you're trying to accomplish?


As the owner of the site, it's always (in my opinion) required to have all the access over other users. That you can view and delete anyone's folders/files if needed.

Edited by ffskyrider on 11/28/08 05:01 AM (server time).

Re: Change FTP Home Directory?

Posted by: sdayman
Posted on: 2008-11-28 07:17:00

In UNIX, that "owner" is called "root," and we don't get that kind of access, which is why we have to use the Unix Groups approach listed above.

-Scott

Re: Change FTP Home Directory?

Posted by: ffskyrider
Posted on: 2008-11-28 07:25:00

I tried doing the groups, but it keeps telling me in putty that access is denied when I attempt to add a group on a folder. Quite annoying >_>.

Re: Change FTP Home Directory?

Posted by: sdayman
Posted on: 2008-11-28 09:50:00

You'd have to be the Owner of that folder to change the group.

-Scott

Re: Change FTP Home Directory?

Posted by: ffskyrider
Posted on: 2008-11-28 09:52:00

In reply to:


You'd have to be the Owner of that folder to change the group.

-Scott


I thought adding a group to a specific folder through shell is already owner like?

Re: Change FTP Home Directory?

Posted by: sdayman
Posted on: 2008-11-28 16:05:00

Nope. It's like lending the keys of your car. It's still *your* car and *you* get to decide who gets to drive it. You don't want your friends deciding who should drive your car.

-Scott

Re: Change FTP Home Directory?

Posted by: sXi
Posted on: 2008-11-28 22:03:00

In reply to:

As the owner of the site, it's always (in my opinion) required to have all the access over other users.


If you are adamant that ftp is the only way to go with this, then you could setup a crontab in each individual member's account that chown's the upload directory contents to your admin user every so-often, thus giving you full rights.

I think what you're trying to accomplish would be easier to do using php or cgi upload scripts which are linked to each member's folder. For example, member1 logs in and goes to the upload page. Anything he uploads is placed in the ~/domain.com/team/member1/ directory.


In reply to:

It's still *your* car and *you* get to decide who gets to drive it. You don't want your friends deciding who should drive your car.


That's probably the best analogy I've read that clearly explains/justifies ownership within UNIX.




How To Install PHP.INI / ionCube on DreamHost

Tags: default homehome directory