Skip to content

[Fix] Resolve SSH Directory Issue#1054

Merged
saeedvaziry merged 2 commits intovitodeploy:3.xfrom
RichardAnderson:fix/wp_phpmyadmin
Mar 17, 2026
Merged

[Fix] Resolve SSH Directory Issue#1054
saeedvaziry merged 2 commits intovitodeploy:3.xfrom
RichardAnderson:fix/wp_phpmyadmin

Conversation

@RichardAnderson
Copy link
Member

@RichardAnderson RichardAnderson commented Mar 17, 2026

This pull request introduces a minor change to the exec method in app/Helpers/SSH.php to improve command execution context. The update ensures that commands run as a specific user are executed from the user's home directory.

  • Command Execution Context:
    • Modified the command template to include a cd /home/{$this->asUser} statement before executing commands as the specified user, ensuring the working directory is set appropriately.

Resolves #1045
Resolves #1034

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to fix failures when executing SSH commands as an isolated site user by ensuring the command runs from that user’s home directory (instead of inheriting the SSH login user’s working directory).

Changes:

  • Prepends a cd /home/<asUser> before running sudo -u <asUser> bash in SSH::exec() to adjust the working directory for commands executed as another user.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@RichardAnderson
Copy link
Member Author

Grumble grumble, copilot came up with a better solution.

@saeedvaziry saeedvaziry merged commit 9d266f4 into vitodeploy:3.x Mar 17, 2026
3 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

3 participants