Fix screen multiuser attach permission error - #142
Merged
Conversation
Remove the failing sudo -u nexus screen -X acladd command that caused "seteuid: Operation not permitted" errors. Instead, grant all users access at session creation time by adding "aclchg :+rwx \"#\"" to the screenrc configuration. This approach: - Avoids the privilege conflict between sudo -u and screen's setuid - Grants permissions upfront rather than at attach time - Eliminates the need for runtime ACL manipulation - Works reliably across all screen versions Changes: - server/core/job.py: Add aclchg command to SCREENRC_CONTENT - cli/jobs.py: Remove the acladd SSH command from attach flow 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
elyxlz
force-pushed
the
fix-attach-ssh-port
branch
from
November 19, 2025 11:45
af30e45 to
6ed90df
Compare
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
nx attachwith remote serverssudo -u nexus screen -X acladdcommandProblem
After adding SSH port support,
nx attachstarted failing with:Root Cause: The
sudo -u nexus screen -X acladdcommand creates a privilege conflict with screen's setuid mechanism. When screen has the setuid bit set (required for multiuser mode), wrapping it insudo -uconfuses screen's internal privilege management, causing theseteuid()syscall to fail.Solution
Based on extensive research of GNU screen documentation and community solutions:
Before: Runtime ACL manipulation via
sudo -u nexus screen -X acladd <user>After: Pre-configure multiuser permissions at session creation time
Changes
File:
src/nexus/server/core/job.pyaclchg :+rwx "#"to SCREENRC_CONTENT (line 37)File:
src/nexus/cli/jobs.pysudo -u nexus screen -X acladdWhy This Works
Test Plan
nx attach <job_id>works without seteuid errorsuv run pyrightto verify type safety (passes ✓)Version
Bumped to 0.5.31b1 (beta) as this changes core screen session behavior.
🤖 Generated with Claude Code