Remote Execution fails with error: unable to execute /var/tmp/foreman-ssh-cmd/xxxxxxxx/script: Permission denied.

Solution Verified - Updated

Environment

  • Red Hat Satellite 6

Issue

  • Remote Execution fails with the below error:

    sh: unable to execute /var/tmp/foreman-ssh-cmd/xxxxxxxx/script: Permission denied
    

Resolution

  • On the host running remote jobs, if /tmp or /var/tmp is mounted with noexec permissions then perform the below steps:

    • Edit /etc/fstab and remove noexec from /tmp and /var/tmp mount points.

    • Remount /tmp and /var/tmp to apply those changes

      # mount -o remount /tmp
      # mount -o remount /var/tmp
      

Root Cause

  • Wrong permission is set on host /var/tmp or /tmp.

Diagnostic Steps

  • On the affected content host, check the permissions set for /var/tmp & /tmp in /etc/fstab.

    [root@host ~]$ cat /etc/fstab
     
    /dev/mapper/rootvg-tmp  /tmp   xfs   defauts,nodev,nosuid  0 0
    /dev/mapper/rootvg-var_tmp /var/tmp   xfs defauts,nodev,noexec,nosuid  0 0  
    
SBR
Product(s)
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.