Skip to content

feat(pam): default ssh access to interactive shell - #377

Merged
x032205 merged 4 commits into
mainfrom
PAM-428
Aug 28, 2026
Merged

feat(pam): default ssh access to interactive shell#377
x032205 merged 4 commits into
mainfrom
PAM-428

Conversation

@x032205

@x032205 x032205 commented Aug 27, 2026

Copy link
Copy Markdown
Member

Description 📣

Makes the SSH access CLI command default to an interactive shell, like web access. Before it would default to just starting a proxy.

Type ✨

  • Bug fix
  • New feature
  • Improvement
  • Breaking change
  • Documentation

@x032205
x032205 requested a review from bernie-g August 27, 2026 01:11
@linear

linear Bot commented Aug 27, 2026

Copy link
Copy Markdown

PAM-428

@infisical-review-police

Copy link
Copy Markdown

💬 Discussion in Slack: #pr-review-cli-377-feat-pam-default-ssh-access-to-interactive-shell

Posted by Review Police — reviews, comments, new commits, and CI failures will stream into this channel.

@greptile-apps

greptile-apps Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR changes SSH PAM access to open an interactive shell by default while retaining an explicit local-proxy mode and adding direct remote-command execution.

  • Adds --proxy and -- <command> CLI modes with SSH-specific validation.
  • Implements direct SSH transport, terminal raw mode, resize handling, signal/expiry handling, and remote exit-code propagation.
  • Updates unit and end-to-end coverage for proxy and direct-command paths.

Confidence Score: 4/5

The direct SSH path should not merge until interruption during connection establishment reliably terminates the newly created PAM session.

The PAM session is created before dialing begins, but SIGINT and SIGTERM are not intercepted until all handshakes finish, so an interruption during a slow or stalled dial can bypass the only explicit session-termination call.

Files Needing Attention: packages/pam/local/ssh-shell.go, packages/pam/local/access.go

Important Files Changed

Filename Overview
packages/cmd/pam.go Adds explicit SSH proxy and remote-command syntax, validates conflicting modes, and passes structured access options into the PAM layer.
packages/pam/local/access.go Routes SSH sessions among direct shell, remote command, and proxy modes, but direct-session cleanup depends on RunSSHShell returning.
packages/pam/local/ssh-shell.go Implements the direct SSH client and terminal lifecycle; signal handling starts too late to clean up a session interrupted during connection establishment.
packages/pam/local/ssh-shell-resize.go Adds SIGWINCH-based terminal resize propagation on non-Windows platforms.
packages/pam/local/ssh-shell-resize_windows.go Adds polling-based terminal resize propagation on Windows.
packages/pam/local/ssh-shell_test.go Covers command execution, exit codes, gateway traversal, and interactive terminal restoration, but not interruption during connection establishment.
e2e/pam/ssh_test.go Updates proxy coverage for the explicit flag and adds direct-command end-to-end coverage.

Reviews (1): Last reviewed commit: "feat(pam): default ssh access to interac..." | Re-trigger Greptile

Comment thread packages/pam/local/ssh-shell.go Outdated
x032205 and others added 2 commits August 27, 2026 12:53
The PAM session exists server-side from creation, but signal handling was
only armed after the relay, gateway and SSH handshake completed. Ctrl+C
during connection setup exited before NotifySessionTermination ran and
left the session live until expiry.

Arm the watch before the gateway capability check and the dial. When a
signal arrives before the client attaches, end the session and exit
128+signum; signals are restored to default first so a second one is not
swallowed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Comment thread packages/cmd/pam.go Outdated
Comment thread packages/cmd/pam.go
Comment thread packages/pam/local/access.go Outdated
@x032205
x032205 merged commit e43fa93 into main Aug 28, 2026
31 of 32 checks passed
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.

2 participants