• Webconn Technology
    • GPU Server
      • Dedicated GPU Servers with NVIDIA RTX/A100 GPUs for accelerated AI training, rendering, and scientific computing. Features CUDA cores, 24GB-141GB VRAM, and parallel processing. Pre-configured with TensorFlow/PyTorch.

      • nvidia rtx A6000
    • Dedicated Server
      • Experience blazing-fast speeds & ironclad security with your own dedicated server. No shared resources. Fully customizable plans for gaming, e-commerce, and big data. Start now!

      • datacenter
    • Shared Hosting
      • Get user-friendly DirectAdmin shared hosting for your website. Enjoy an intuitive control panel, one-click app installs, and reliable performance. Perfect for blogs, small business sites, and portfolios.

      • shared hosting web
    • Domains
      • Search and register the perfect domain name for your website. Get a memorable .com, .net, .org or niche TLD to start building your brand online. Includes free privacy protection.

    • VPS
      • Experience the power of a dedicated server without the high cost. Our VPS hosting guarantees CPU, RAM, and storage for your site, ensuring optimal performance and stability.

      • data center
  • Blog
  • Dashboard

rsync: Failed to exec ssh: Permission denied (13)

Category:

When another SELinux confined process starts rsync, it fails with the following error.

rsync: Failed to exec ssh: Permission denied (13)

The following error may appear in some cases.

rsync: readlink_stat("/some_file" (in some_path)) failed: Permission denied (13)

To resolve the above issue, turn on the following SELinux Booleans.

  • rsync_client to allow rsync client to run ssh
  • rsync_export_all_ro to allow rsync to access (read-only) all
# setsebool -P rsync_export_all_ro 1
# setsebool -P rsync_client 1

If another SELinux restricted process (such as an initrc script or another application) starts rsync, the resulting process will also be confined to the rsync_t context.
This context does not allow the ssh command to be run by default, and it can only read files in a few specified security contexts, such as rsync data_t and public_content_t.

Check the audit logs for rsync errors.

# ausearch -m avc -i -c rsync

Use audit2allow to identify which boolean needs to be activated.

# ausearch -m avc -i -c rsync | audit2allow

#============= rsync_t ==============

#!!!! This avc can be allowed using the boolean 'rsync_client'
allow rsync_t ssh_exec_t:file execute;

#!!!! This avc can be allowed using one of the these booleans:
#     rsync_export_all_ro, rsync_full_access
allow rsync_t unlabeled_t:dir search;

Check the current value of the following rsync booleans.

# getsebool -a | grep rsync_

rsync_anon_write --> off
rsync_client --> off
rsync_export_all_ro --> off
rsync_full_access --> off
rsync_sys_admin --> off

Leave a Reply