Understanding symlinks and hosting directory access

A symbolic link points to another filesystem path instead of containing an independent copy of the target. Hosting security controls may limit which links a website can follow, especially across account boundaries.

Information to have ready

Identify who owns the link and target and why the application uses it. Back up configuration before changing a deployment layout. Do not assume a link grants access that the account would otherwise lack.

01 Check the symlink target and permitted access

  1. Use File Manager or an authorised read-only shell listing to distinguish the link from a real directory. Record its target path.
  2. Check that the target exists and belongs within the permitted account scope. A broken link can survive after a deployment folder is renamed or removed.
  3. Review the application’s supported directory layout and the provider’s symlink policy. Shared-hosting isolation can intentionally prevent cross-account targets.
  4. If a target path changed, update the deployment configuration through its supported process rather than copying arbitrary links from another server.
  5. Test both direct application behaviour and web requests through the linked path. Keep private storage inaccessible to public HTTP requests.

02 Example: identify a symlink before following it

Use an authorised hosting-account terminal to inspect the suspected symbolic link. Replace current with the actual link path. These commands display the link and its target text; they do not change it or grant access to a directory outside your account.

Command example
ls -ld /home/CPANEL_USER/public_html/current
readlink /home/CPANEL_USER/public_html/current

Read the result: The long listing identifies the item as a symbolic link and shows its destination. A relative destination is interpreted from the directory containing the link, not from whichever directory your shell currently uses. A dangling target or a target blocked by hosting isolation can explain an access error.

Compare the target with the intended release directory and ownership before changing deployment settings. A valid symlink does not override the destination's permissions, open_basedir rules or web-server symlink policy. Ask support to confirm permitted use if the design crosses account or filesystem boundaries.

Confirm the expected result

The link should resolve to the intended permitted location and expose only the data the application requires. Confirm the apparent folder is not unexpectedly pointing to another site’s release.

Troubleshoot unexpected results

If the server refuses to follow a link, do not disable global protections or broaden another account’s permissions. Use an approved directory layout or ask support about a suitable deployment design.

Does deleting a link delete the target?

Removing only the symbolic link leaves its target in place. Recursively deleting contents reached through a link is a different operation. File tools and command options vary, so inspect the object and avoid recursive cleanup commands until you know exactly which real directory they will affect.

  • 0 Users Found This Useful
  • cpanel-whm, web-hosting
Was this answer helpful?

Related Articles

Uploading website files with cPanel File Manager

File Manager is useful for a small deployment or a single file change without installing an FTP...

Creating files and folders in cPanel File Manager

Create a folder to organise website assets or a file for a specific application task. An empty...

Editing a text file in cPanel File Manager

File Manager can make a focused change to a website text or configuration file. Saving writes...

Finding and editing .htaccess in cPanel

The .htaccess file can control redirects, access restrictions and application rewrite rules on...

Creating a restricted cPanel Web Disk account

Web Disk provides WebDAV access to server files. An additional Web Disk user can manage a...