Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

My web host uses an elegant way of handling multiple sites while keeping each one self-contained. For me to login via ssh, I use the following:

ssh hostname -l username1_sitename1

This does something along the lines of chroot-ing me to the particular directory related to sitename1 and changing my UID to match. Same for if I used ssh hostname -l username1_sitename2, etc. The login for username1 uses the same password each time and the hostname remains constant.

If another user, username2, were to need access to sitename1 then they can access said site using a similar scheme:

ssh hostname -l username2_sitename1

and they would be given the same UID as username1 receives when accessing sitename1.

I wish to replicate a similar scheme on one of my computers. Is it possible to achieve this without manually adding each incarnation of username_sitename to the system?

share|improve this question

migrated from superuser.com Dec 12 '11 at 16:47

This question came from our site for computer enthusiasts and power users.

1 Answer 1

Short answer: Thousands of perl scripts, son!

Long answer: Once you get into the large hosting game, you want everything to be done via scripting, and all your backend processes to talk to one another. Manual intervention means you lose. You want one click access to suspend, create, delete, etc. So, it's most likely not "manually" created, but someone on their side got an idea of how they want to implement things, and then wrote the necessary code to add these names to all the appropriate places, set up the permissions, etc. As most things with hosting like this, it can be done, you just need to implement it according to your specific desires.

share|improve this answer
    
Along with the scripts, I would also use something like urpmi or jailkit for creating a custom jail with only specific utilities for user groups or in your case according to the sitename. –  fmysky Dec 16 '11 at 20:15

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.