GNU Screen 4.99+ password deactivation patch
by Marc Gloor

The problem
When you detach a GNU Screen session version 4.99 (C-a d), the only way to re-attach the session (screen -r <session>) is by unlocking the session using a password. There are situations where you don't like to be forced to use passwords e.g. in a passwordless intranet or test environment.

My issue with current GNU screen versions shipped with most linux distributions

I had to use the most recent screen version from github due to the fact that this was the only way that bashtop was displayed properly within a screen session. A rotating monitoring script that I wrote autonomously switches between 4 detached screen sessions in a 5 sec (re-attaching) interval. After investigating a while, I couldn't figure out a way using the docs to disable GNU screen's password prompt when re-attaching a detached session. My rotation script's intention was spoiled with this screen 'force password' feature so I decided to take action against it to workaround my issue.

The issue with latest GNU Screen 4.99
From ChatGPT I learnt, that in GNU Screen 4.99, the ability to disable passwords was removed, and there is no straightforward configuration option to achieve this. Password authentication is now enforced by default in GNU Screen 4.99 and later versions. If you require a passwordless screen session, one possible workaround is to downgrade to an earlier version of GNU Screen that still supports disabling passwords. However, keep in mind that downgrading software versions may have other implications and could introduce potential security vulnerabilities. Alternatively, you may consider exploring alternative terminal multiplexer options that provide passwordless session management, such as tmux.

Installation
mkdir /tmp/screen.d && cd /tmp/screen.d
wget https://marcgloor.github.io/data/screen-git-nopasswd-patch.tar.gz
tar xzf screen-git-nopasswd-patch.tar.gz
git clone https://git.savannah.gnu.org/git/screen.git
cd screen/src
zcat ../../screen-git-nopasswd-patch/screen-git-nopassword.patch.gz | patch -p1 (file to patch: socket.c)
./autogen.sh
./configure
make
make install
eventually create a symlink: ln -s /usr/local/bin/screen /bin/screen

Note
Not sure ChatGPT's proplem analysis was trustworthy. For me, it was the only root-cause I could determine and foundation to the problem resolution of my issue. This page provides you with an unofficial GNU Screen patch that removes the forced password feature when re-attaching sessions. Note, that the password functionality in GNU screen should be generally available, so that screen sessions can be locked when away from the screen for a while. Entirely killing this security feature is not the correct way to handle this. My patch is a temporary workaround. I initially contacted the maintainers/developers on 24th of May 2023 about this and opened a bug report #64254 in order to verify that this is intended behaviour. Update follows.


$Id: gnuscreenpatch.html,v 1.8 2023/05/26 02:11:48 gloor Exp $
Author:
marc_dot_gloor_at_u_dot_nus_dot_edu


home