| SYSTEM INFORMATION | |
|---|---|
| OS type and version | Ubuntu 26.04.1 LTS (Resolute Raccoon) |
| Webmin version | 2.671 |
| Virtualmin version | 8.3.0 |
| Web server version | Apache HTTP Server 2.4.69 |
I am experiencing an issue with file ownership on my website hosted through Virtualmin, where files uploaded through the Virtualmin File Manager sometimes end up with ownership or permissions that prevent the website from accessing them correctly. The upload itself completes successfully, and the files appear in the expected directory when I browse the virtual server’s document root, but the website cannot always read or process those files afterward. In some cases, a page that depends on an uploaded file stops working as expected, or the server returns a permission-related error even though the file is present in the correct location. When I inspect the affected files, their ownership does not always appear to match the other files in the same website directory. This is becoming difficult to manage because the website otherwise works normally, and the problem seems to be related to how uploaded files are assigned ownership rather than the upload process itself. I would like to understand why this happens in Virtualmin and how to ensure that files uploaded through its File Manager are accessible to the correct website user.
I first noticed the issue when I uploaded several files to an existing directory that already contained working website content. The newly uploaded files appeared in the directory, but the application could not access some of them in the same way it accessed the older files. When I compared their properties, I noticed differences in ownership or permissions that made me question whether the upload operation was using the expected account. I understand that Linux file access depends on the owning user, group, and permission bits, and that the correct settings can vary depending on how a virtual server and its web application are configured. However, I have not deliberately changed the ownership of the existing website files, and I would expect uploads performed through the management interface to follow the appropriate configuration for that virtual server. I have not yet established whether the difference comes from the account used by the File Manager, the virtual server’s ownership settings, or another aspect of the server configuration.
To investigate further, I have compared the affected files with nearby files that the website can access successfully. The directory paths appear correct, and the files are located under the intended website document root rather than an unrelated location. The problem therefore does not appear to be caused simply by uploading content into the wrong directory. I have also checked the visible permission values, but I am hesitant to change them recursively because doing so could affect files that intentionally require different permissions. For example, ordinary content files, executable scripts, and directories may need different access settings, and applying one generic permission value to everything could introduce security problems. What I would like to identify is why the newly uploaded files are receiving ownership or permission settings that differ from the existing content, and whether Virtualmin has a built-in mechanism for maintaining the expected ownership when files are uploaded through its File Manager.
I am also unsure how the File Manager determines which Linux user and group should own an uploaded file. My understanding is that a Virtualmin virtual server normally has an associated system user, but I do not know whether the File Manager always performs uploads using that account or whether the result can depend on how the management interface or relevant services are configured. If the upload process creates files under a different account, I would like to know how to identify that behavior safely and determine whether it is expected. I have not attempted to solve the issue by making the entire website directory writable by every user, because that would be an unsafe workaround and would not explain why the ownership is inconsistent. I would prefer to correct the underlying configuration so that files uploaded through the normal Virtualmin workflow receive appropriate ownership without requiring me to manually repair each file afterward.
For troubleshooting purposes, I can provide the operating system version, Webmin and Virtualmin versions, the affected virtual server’s configuration, and sanitized output showing the ownership and permissions of one affected file alongside a working file in the same directory. I would appreciate advice on which commands or Virtualmin screens can confirm the expected system user and group for the domain and help identify the account under which the File Manager creates files. I would also like to know whether there is a recommended Virtualmin procedure for correcting ownership on existing files without changing permissions unnecessarily or affecting other virtual servers hosted on the same machine. If a diagnostic command can show whether the file ownership is inconsistent with the virtual server’s configured user, that would be particularly useful. My goal is to make the file upload process reliable while preserving the normal security boundaries between hosted websites and avoiding broad permission changes that could create additional problems.
Has anyone encountered a similar file ownership issue with uploads performed through Virtualmin’s File Manager, where the files appear in the correct directory but the website cannot access them because their ownership differs from the existing content? I would appreciate guidance on how to trace the ownership assignment during an upload and determine whether the behavior is controlled by Virtualmin, the underlying system user, or another server configuration. I am trying to resolve this as a single file ownership problem rather than applying a temporary permission workaround every time I upload something. Any recommendations for the safest way to diagnose and correct the cause would be helpful. I have included the system information fields below so that the issue can be considered in the context of my installed environment, and I can provide the actual version details and relevant file-property output when needed. How do I fix it?