Multiple domains and multiple SFTP or FTP accounts

March 26, 2014 1.2k views
I have managed to set up 2 domains on my account and have them both up and running, however how do I set SFTP or FTP access to those folders using and ?
1 Answer
I believe the way to do it would be to create 2 users on the remote system, set their home directories as the two respective folders and change the ownership on the contents of the folders to the correct user.

Something like:

1) useradd user1 -d /path/to/dir1
2) useradd user2 -d /path/to/dir2
3) passwd user1
4) passwd user2
5) chown -R user1 /path/to/dir1
6) chown -R user2 /path/to/dir2

and then you can use sftp user1@host etc :)
Have another answer? Share your knowledge.