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

This question already has an answer here:

When a user logins to my Debian server using e.g. Putty, I need to perform the following:

  1. It will automatically execute command screen -r MyWindow, and
  2. the user won't be able to leave the screen window, so I want the user to have disabled all commands.

How can I do that?

share|improve this question

marked as duplicate by jasonwryan, vonbrand, Thor, manatwork, rahmu Apr 17 '13 at 11:46

This question was marked as an exact duplicate of an existing question.

1  
Do these users login locally, too? And if so, shall screen not be started in this case? – Hauke Laging Apr 17 '13 at 8:46
    
You need give a much better description of your problem! 1. you can tie users only to sessions, not windows. 2. Without recompiling screen, you cannot prevent a user from issuing commands. – Bananguin Apr 17 '13 at 9:56

Here is a screenrc that disables interactive commands (it may not be tamper-proof).

unbindall
escape ""
defescape ""
shell /bin/false

Use it to start your screen server. Then attach to the same screen server on login, using an SSH forced command.

share|improve this answer

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