Files in home directory?


#1

From the wiki, I gathered that the directory structure for an account follows

/home/username/
/home/username/domain1.com/
/home/username/sub1.domain1.com/
/home/username/domain2.com/

Can you add directories and files in the home directory? For example, could you create:

/home/username/templates/

Also, if you add FTP users, can their access be limited to the specific domain directory, such as /home/username/domain2.com/, or will they have access to the home directory as well?

Thanks!


#2

Can you add directories and files in the home directory?

Yes, as many as you want.

Also, if you add FTP users, can their access be limited to the specific domain directory, such as /home/username/domain2.com/, or will they have access to the home directory as well?

No. Each user is equal, which means that if you add user2 to your account, her home directory will be /home/user2

If you give her control over one of your sites via the control panel, the filesystem path to this site’s directory will be /home/user2/(sub.)example.org

If you want to share a site with this user, with both of you having access to all the files in a given site, you can set group permissions via SSH.


If you want useful replies, ask smart questions.


#3

[quote]you can set group permissions via SSH.

[/quote]

I tried this a few years ago and it didn’t work. I take it works now? If so, do you know of any place with good instructions on how to do it?


#4

Create a new group in the control panel that includes yourself and the other user(s) you want. After this takes effect, log in via SSH. You can verify your group membership by typing at the shell prompt:

groups groups other_user If everything is ok, change the ownership and permissions of the directory you want. For this example, we’re giving another user full permission to the example.org directory.

chown -R :groupname example.org chmod -R g+w example.org For convenience, each user can create a symlink in their home directory pointing to the actual directory in your space. If you’re setting up other user accounts at the same time, and therefore know their passwords, you can switch to their account for this:

su - other_user ln -s /home/your_username/example.org example.org They can also do this themselves. This will create a symlink in their directory with the same name as the one in yours (the domain in question). This symlink can actually be named anything you want.


If you want useful replies, ask smart questions.


#5

Thanks. I had a few group setup before, so now I went in and did the chown and chmod. Is the symlink required? So far it’s not working.

I’ve got:
/user1/sub.domain.com/

So I set it so that user1 and user2 were in a group called “world”

Then did chown -R :world sub.domain.com
and
chmod -R g+w sub.domain.com

I can FTP into user1@sub.domain.com/sub.domain.com and end up in the correct directory. however, when I do user2@sub.domain.com/sub.domain.com I get a 550.

What am I doing wrong?


#6

You’re getting an error because FTP connections are restricted to the home directory of the user you’re connecting as. The symlink should fix this.

This restriction does not apply to SFTP connections, which you really should be using anyway. FTP is archaic and insecure; there’s no reason to use it in this day and age.


If you want useful replies, ask smart questions.


#7

I tried it via SFTP and get a similar error. “SSH_FXP_STATUS SSH_FX_NO_SUCH_FILE No such file”

Nevermind, I was doing something wrong. Fixed that, but I can’t write.
“SSH_FXP_STATUS SSH_FX_PERMISSION_DENIED Permission denied”

(I just use FTP as it’s an old habit. My FTP client works the same no matter which I use, just gotta remember to type the S… well, that and some of the bookmarks are verging on ~8 years old.)