Change FTP Home Directory?


#1

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


#2

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

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost


#3

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.


#4

Nearest easy way to setup that would be:

  • Setup the new [color=#0000CC]user[/color] 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/[color=#0000CC]user[/color]/upload

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost


#5

Thanks I’ll try that.


#6

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 denied


#7

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.

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost


#8

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?


#9

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?

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost


#10

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.


#11

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


#12

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 >_>.


#13

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

-Scott


#14

[quote]
You’d have to be the Owner of that folder to change the group.

-Scott[/quote]
I thought adding a group to a specific folder through shell is already owner like?


#15

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


#16

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, [color=#0000CC]member1[/color] logs in and goes to the upload page. Anything he uploads is placed in the ~/domain.com/team/[color=#0000CC]member1[/color]/ directory.

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

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost