Have the setup's sudo grant remove itself within the hour, and keep a target from reading as an ssh option

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ilker ManapandClaude Opus 5.5 committed 2026-10-04 10:17:52 +02:00
1 parent 1f406247e4
commit ebf437a36a
4 files changed
+47 -7

No files matched your search

+3 -1
View File
@@ -41,7 +41,9 @@ func (s *SSH) Run(ctx context.Context, script string, stdin []byte) ([]byte, err
if s.User != "" {
target = s.User + "@" + s.Addr
}
args := append(append([]string{}, sshOptions...), target, "sh", "-c", shellQuote(script))
// "--" before the target: an address beginning with "-" is not read as
// an option.
args := append(append([]string{}, sshOptions...), "--", target, "sh", "-c", shellQuote(script))
cmd := exec.CommandContext(ctx, "ssh", args...)
if stdin != nil {
cmd.Stdin = bytes.NewReader(stdin)