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.

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

2 Answers

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

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. –  Stephane 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
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.