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.

Let's say I have 10 user accounts. I want that users logged in will use an instance of that account not the account itself.

So when they log in, they will work on a copy of that account that should be dropped as soon as they log out. if two or more users are using the same account, they should not be able to see each other's files.

If they return to that account they should the initial state.

share|improve this question
add comment

migrated from stackoverflow.com Nov 15 '11 at 17:19

This question came from our site for professional and enthusiast programmers.

closed as too localized by voretaq7, Tom O'Connor, Iain, Chris S, Ward Nov 15 '11 at 18:49

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

2 Answers

What goal are you trying to accomplish?

What you're describing is generally not useful (the only case I can ever see where it would be useful is on a public-access unix system where you let people log in as "guest" and they get redirected to a guest1234 account which gets deleted when they log out. You can implement such a horrible thing with PAM modules or some hackery to the login binary, but it's generally a Bad Idea, and therefore left as an exercise for the reader.

share|improve this answer
    
I'm trying to create a CTF Security contest where users may be at the same level (user account) without sharing sessions and messing with each other. Also if they ruin the level, they should be able to log out and log back in again with the initial state restored... –  user504886 Nov 15 '11 at 18:51
add comment

You're Doing It Wrong

It's tough to completely accomplish such a thing. There's all sorts of hacks that you could try, such as:


Add to login script:

NEWHOME=$(mkdir $HOME/.tmphome.XXXXXX)
export HOME=$NEWHOME
(spawn rest of session)

And that would get you most of the way there.

Or perhaps, have everyone log ssh a single meta-guest account that:

  • locks the semaphore
  • picks the next unused guest account
  • re-initializes that guest account (wipes out files, etc)
  • uses ssh/sudo/whatever to change to that guest account
  • unlocks the semaphore
share|improve this answer
add comment

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