[PR #478] [MERGED] fix: handle special characters in SSH password/passphrase (Fixes #312) #474

Closed
opened 2026-02-26 12:41:30 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/community-scripts/ProxmoxVE-Local/pull/478
Author: @michelroegl-brunner
Created: 1/29/2026
Status: Merged
Merged: 1/29/2026
Merged by: @michelroegl-brunner

Base: mainHead: fix/312


📝 Commits (1)

  • 4bc5f4d fix: handle special characters in SSH password/passphrase (Fixes #312)

📊 Changes

3 files changed (+59 additions, -31 deletions)

View changed files

📝 src/app/_components/ServerForm.tsx (+5 -0)
📝 src/server/ssh-execution-service.js (+49 -28)
📝 src/server/ssh-service.js (+5 -3)

📄 Description

Summary

Fixes #312 — script install fails when SSH password contains special characters (e.g. {).

Changes

  • transferScriptsFolder: Use sshpass -f with a temporary file instead of sshpass -p ${password} so the password/passphrase never goes through the shell. Temp file is created with mode 0600 and removed in close/error/catch.
  • testWithExpect: Pass password via SSH_PASSWORD env var and use $env(SSH_PASSWORD) in the expect script so the password is not embedded in the script string (safe for {, }, $, ", etc.).
  • ServerForm: Add hint when password auth is selected: SSH key recommended; special characters supported.

Testing

  • Passwords containing {, }, $, ", space, backslash work for script install and connection test.
  • Key auth (with/without passphrase) unchanged.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/community-scripts/ProxmoxVE-Local/pull/478 **Author:** [@michelroegl-brunner](https://github.com/michelroegl-brunner) **Created:** 1/29/2026 **Status:** ✅ Merged **Merged:** 1/29/2026 **Merged by:** [@michelroegl-brunner](https://github.com/michelroegl-brunner) **Base:** `main` ← **Head:** `fix/312` --- ### 📝 Commits (1) - [`4bc5f4d`](https://github.com/community-scripts/ProxmoxVE-Local/commit/4bc5f4d6ad08e38329ead2f9a4db20a3f8979c76) fix: handle special characters in SSH password/passphrase (Fixes #312) ### 📊 Changes **3 files changed** (+59 additions, -31 deletions) <details> <summary>View changed files</summary> 📝 `src/app/_components/ServerForm.tsx` (+5 -0) 📝 `src/server/ssh-execution-service.js` (+49 -28) 📝 `src/server/ssh-service.js` (+5 -3) </details> ### 📄 Description ## Summary Fixes #312 — script install fails when SSH password contains special characters (e.g. `{`). ## Changes - **transferScriptsFolder**: Use `sshpass -f` with a temporary file instead of `sshpass -p ${password}` so the password/passphrase never goes through the shell. Temp file is created with mode 0600 and removed in `close`/error/catch. - **testWithExpect**: Pass password via `SSH_PASSWORD` env var and use `$env(SSH_PASSWORD)` in the expect script so the password is not embedded in the script string (safe for `{`, `}`, `$`, `"`, etc.). - **ServerForm**: Add hint when password auth is selected: SSH key recommended; special characters supported. ## Testing - Passwords containing `{`, `}`, `$`, `"`, space, backslash work for script install and connection test. - Key auth (with/without passphrase) unchanged. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 12:41:30 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ProxmoxVE-Local#474
No description provided.