Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Many a times, I want my colleague to have a look at some code on my system. He will mostly do it at his free time, and will need to login as me.

Is there a way I can open a new shell as me, and then transfer the shell to him on his machine, so that he can use it whenever he wants to?

share|improve this question
If you don't mind that he can have all your user's rights screen + ssh can do this pretty well. – stribika Mar 5 '11 at 22:40

I would consider using screen to do this. Although, the only method I know of does produce some security concerns. Screen has the ability to create access control lists and the ability to allow multiple screen sessions with a variety of permissions. The setup can be a bit tricky, but the idea is this:

  1. Create a user account for your coworker.
  2. Give your coworker ssh access to your machine.
  3. Make the screen executable setuid root (dangerous).
  4. Change the permissions on /var/run/screen to 755 (Other permissions setups might be doable, this is just what I've always done. Also, this is the path on Debian, I'm unsure if it is different elsewhere)
  5. Edit your ~/.screenrc to enable multiuser mode:

    multiuser on 
  6. Edit your ~/.screenrc to set up the right permissions using the commands: acladd, aclchg, and aclgrp. See the man pages for the details.

Your coworker could then log into your machine via ssh and connect to your screen session. Via the ssh config, you could actually force him to connect to the screen session upon his logging in. The following blog post has more detailed instructions (these directions are roughly based off of them) in the context of holding a class using screen:


Your use case is a bit different, but I think that the only real difference will be the permissions you set in ~/.screenrc and the name of the user.

share|improve this answer

screen -x ought to be the simplest solution.

share|improve this answer

Your Answer


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.