Stuck on WP media upload (401 Auth error) with CyberPanel/OpenLiteSpeed. Can I just use SSH instead?
I’ve been banging my head against the wall with this for hours and hoping someone here has a workaround.
I have an n8n workflow that spins up a fresh WordPress install on a VPS running CyberPanel (OpenLiteSpeed). That part works fine. The issue is I'm generating an image in the workflow and trying to upload it to the Media Library of this brand new site, but the HTTP Request node keeps failing.
I initially got 404 errors on the standard /wp-json/ endpoint (probably because permalinks act weird on fresh installs), so I switched to the query param style ?rest_route=/wp/v2/media. That fixed the 404, but now I'm stuck in 401 Authorization hell.
I’m using Application Passwords generated via wp-cli in the previous step. I know OpenLiteSpeed tends to strip auth headers, so I even added the rewrite rule to .htaccess to force the Authorization header through and restarted the server. Still getting "Authorization failed" or "User cannot create posts" errors, regardless of whether I use Basic Auth, Generic Creds, or manually header construction.
Since I already have root SSH access to the server in this workflow, I feel like I'm overcomplicating this by trying to force the REST API to work.
Is there a way to just drop the binary file from the n8n node directly onto the server using the SSH node? Like an SCP transfer? If I can just get the jpg into the uploads folder, I can run a wp media import command to register it and be done with this API nightmare.
Has anyone moved binary data to a file via SSH in n8n?
HALP. THANKS 🙏🏼
Posted Nov 28, 2025, 5:41 PM UTC