Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
add comment

2 Answers

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:

http://blog.dustinkirkland.com/2009/04/teaching-class-with-gnu-screen.html

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
add comment

screen -x ought to be the simplest solution.

share|improve this answer
add comment

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.