Skip to content

Let Claude ssh to the Hosts from ~/.claude, for the user and root; make autocomplete (0.7.12) - #58

Merged
2styx2 merged 1 commit into
devfrom
feat/claude-ssh-access
Nov 12, 2026
Merged

2styx2 merged 1 commit into
devfrom
feat/claude-ssh-access

Conversation

@2styx2

@2styx2 2styx2 commented Nov 12, 2026

Copy link
Copy Markdown
Owner

What

  • roster setup / roster sync write the user's own ~/.claude (opt out with top-level claude: false in roster.yml):
    • CLAUDE.md: @PATH/ROSTER.md, so Claude knows the Hosts from any directory.
    • settings.json: permissions.allow for ssh, scp, rsync, roster ls/check/run; the ~/.ssh deny rules; autoMode.allow with $defaults plus a sentence authorizing logins to the Hosts in ROSTER.md (auto mode reads autoMode only from user settings).
  • Mesh Hosts: the login user gets the same (a missing ~/.claude is made); root too, through sudo -n, because Claude often runs as root: root's settings, an import of the login's ROSTER.md, and an Include of root's own copy of the Mesh config (ssh refuses a config file owned by another user). Where sudo needs a password, root is left out with one hint line.
  • claude: false and setup --undo take it all out again; the user's own keys and rules are kept. Keys come out sorted (serde_json without preserve_order, which would add a crate outside deny.toml).
  • ROSTER.md (Box and Mesh) says Claude has permission to log in.
  • make autocomplete: installs the bash completion and sources it from ~/.bashrc once; make uninstall removes the line.

Tests

New: sync writes/keeps/removes the user's settings; Mesh claude: false keeps root's and the user's own settings; no passwordless sudo gives one hint; undo removes root's part. A fake getent keeps tests out of the real /root. fmt, clippy, all 26 suites pass; line budget 4.8k/10k.

Tried live on a 6-Host Mesh: root on one Host reaches another with ssh NAME; existing settings kept.

…7.12)

roster setup and sync now write the user's own ~/.claude: an import of
ROSTER.md in CLAUDE.md, and in settings.json the allow rules for ssh,
scp, rsync and roster ls/check/run, the ~/.ssh deny rules, and an
autoMode.allow entry ($defaults kept) so auto mode lets the logins
through. On each Mesh Host the login user gets the same (a missing
~/.claude is made), and so does root through sudo -n, since Claude often
runs as root: root's settings, an import of the login's ROSTER.md, and
an Include of its own copy of the Mesh config (ssh refuses a config file
another user owns). Where sudo asks for a password, root is left out
with one hint line.

`claude: false` in roster.yml opts out and takes it all out again;
setup --undo removes it too. The user's own keys and rules are kept
(serde_json writes keys sorted). ROSTER.md says Claude may log in.

Also `make autocomplete`: install the bash completion and source it
from ~/.bashrc, once; `make uninstall` removes the line.
@2styx2
2styx2 merged commit bfba474 into dev Nov 12, 2026
16 checks passed
@2styx2
2styx2 deleted the feat/claude-ssh-access branch November 12, 2026 21:06
@2styx2 2styx2 mentioned this pull request Nov 17, 2026
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