45Drives / cockpit-file-sharing

A Cockpit plugin to easily manage samba and NFS file sharing.
GNU General Public License v3.0
596 stars 32 forks source link

Permission denied when connecting from a remote Cockpit instance #96

Open Tina-otoge opened 10 months ago

Tina-otoge commented 10 months ago

Bug Info

Describe the bug When connecting to a Cockpit instance remotely from another Cockpit instance, we are unable to access the File Sharing plugin with a permission denied error.

To Reproduce Steps to reproduce the behavior:

  1. Have Machine A and Machine B both with Cockpit and File Sharing plugin installed
  2. Connect to Machine A's Cockpit
  3. Add Machine B to the list of hosts by clicking the top left button
  4. Connect to Machine B
  5. Enter sudo mode
  6. Click the File Sharing section
  7. See "You do not have administrator access." error in NFS and "User account lacks permission to configure Samba!" in Samba.

Machine A is served over HTTPS (public-facing machine with Lets Encrypt) and Machine B is served over HTTP (LAN only machine), not sure if this is necessary to reproduce the bug.

Worth noting that accessing Machine B's Cockpit directly while on my LAN does indeed work normally. Only when doing Cockpit to Cockpit it does not.

Expected behavior Other "sudo" actions work fine when accessing Cockpit from another Cockpit instance, such as the "Services" or "Logs" sections, so it is weird that File Sharing does not, I would expect it to work too. If it's not possible, I would expect the error message to explicitly tell me that it is not possible to use this feature when using a remote Cockpit instance.

Screenshots

image

We can see multiple hosts in the left side bar. Current host is logged in "sudo" mode ("Administrative access"), but get denied anyway.

Console Output Not sure if relevant

Click me for browser logs ``` GET https://example.com/cockpit/cockpit/@localhost/*/po.js The resource from “https://example.com/cockpit/cockpit/@localhost/*/po.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff). [file-sharing](https://example.com/cockpit/@nagato.lan/file-sharing/file-sharing) GET https://example.com/cockpit/cockpit/@localhost/*/po.js The resource from “https://example.com/cockpit/cockpit/@localhost/*/po.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff). [file-sharing](https://example.com/cockpit/@nagato.lan/file-sharing/file-sharing) Loading failed for the Githubissues.
  • Githubissues is a development platform for aggregating issues.