diff --git a/ssh.go b/ssh.go index 92ca4c9..bd55ed1 100644 --- a/ssh.go +++ b/ssh.go @@ -343,6 +343,13 @@ func (s *session) request(ctx context.Context, req *ssh.Request) error { return scpSink(s.channel, req, cmdline) } + // Ensure the $HOME directory exists so that shell history works without + // any extra steps. + if err := os.MkdirAll("/perm/home", 0755); err != nil { + // TODO: Suppress -EROFS + log.Print(err) + } + var cmd *exec.Cmd if shell := findShell(); shell != "" { cmd = exec.CommandContext(ctx, shell, "-c", r.Command)