Skip to content

Fix SSH port configuration in nx attach command - #141

Merged
elyxlz merged 2 commits into
masterfrom
fix-attach-ssh-port
Nov 19, 2025
Merged

Fix SSH port configuration in nx attach command#141
elyxlz merged 2 commits into
masterfrom
fix-attach-ssh-port

Conversation

@elyxlz

@elyxlz elyxlz commented Nov 19, 2025

Copy link
Copy Markdown
Owner

Summary

  • Fixes nx attach to use custom SSH port configuration
  • Updates both SSH invocations in attach_to_job() function

Problem

After PR #140 added SSH port support, the nx attach command was still hardcoded to use port 22, causing failures when connecting to remotes with non-standard SSH ports.

Changes

File: src/nexus/cli/jobs.py

  1. Line 1258-1259: Added -p {ssh_port} to screen ACL command

    • Command: ssh ... sudo -u nexus screen -X acladd
  2. Line 1280-1281: Added -p {ssh_port} to screen attach command

    • Command: ssh -t ... screen -x

Impact

Users can now successfully use nx attach with remotes configured on non-standard SSH ports (e.g., port 62420).

Test Plan

  • Verify nx attach <job_id> works with custom SSH port
  • Verify screen ACL permissions are properly set
  • Run uv run pyright to verify type safety (passes ✓)

🤖 Generated with Claude Code

elyxlz and others added 2 commits November 19, 2025 11:18
Update both SSH invocations in attach_to_job() to use custom ssh_port:
- Screen ACL command (sudo screen -X acladd)
- Screen attach command (screen -x)

This ensures nx attach works with non-standard SSH ports.

🤖 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
elyxlz merged commit c75a2d3 into master Nov 19, 2025
4 checks passed
@elyxlz elyxlz mentioned this pull request Nov 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant