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

I'd like to be able to check progress and output of my existing screen sessions, but in a read-only manner, so as to prevent something from going wrong due to user error. Is there a way to do this?

share|improve this question
up vote 4 down vote accepted

Unfortunately, I think the answer is no. The asker of this question switched to tmux specifically because it has that feature (you pass the -r flag when attaching), so if you have the option to switch multiplexers it's probably your best choice

share|improve this answer

You can try:

aclchg username -w "#"

if you run screen in multi user mode (but I didn't have to do anything special to make it work when testing it as a single attached user). If you do need to enter multiuser mode, use multiuser on.

You can use * for the username to affect all users.

Using +w instead of -w enables write mode.

From man screen:

aclchg usernames permbits list
chacl usernames permbits list

Change permissions for a comma separated list of users. Permission bits are represented as 'r', 'w' and 'x'. Prefixing '+' grants the permission, '-' removes it. The third parameter is a comma separated list of commands and/or windows (specified either by number or title). The special list '#' refers to all windows, '?' to all commands. if usernames consists of a single '*', all known users are affected. A command can be executed when the user has the 'x' bit for it. The user can type input to a window when he has its 'w' bit set and no other user obtains a writelock for this window. Other bits are currently ignored. To withdraw the writelock from another user in window 2: 'aclchg username -w+w 2'. To allow read-only access to the session: 'aclchg username -w "#"'. As soon as a user's name is known to screen he can attach to the session and (per default) has full permissions for all command and windows. Execution permission for the acl commands, `at' and others should also be removed or the user may be able to regain write permission. Rights of the special username nobody cannot be changed (see the "su" command). 'Chacl' is a synonym to 'aclchg'. Multi user mode only.

share|improve this answer
While that works, it makes screen readonly everywhere the screen session is attached which looks like is different from what the OP asked. – Stéphane Chazelas Jan 22 '13 at 22:05
@StephaneChazelas: I don't see any indication in the question that the OP is concerned about writability in other instances of a multiply-attached session. Besides, the aclcng command can specify particular users, particular commands and/or particular windows so that's fairly fine granularity. So that's not "everywhere". – Dennis Williamson Jan 23 '13 at 1:59

I have found a fairly simple work-around that allows one to monitor the output safely.

Run the following commands immediately after entering the screen session:

echo /tmp/$STY
touch /tmp/$STY
chmod 0600 /tmp/$STY
script -a -f /tmp/$STY

Detach the session with Ctrl-A d and follow the script output, e.g.:

tail -f /tmp/10751.test
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.