2

When I try to execute any program from the /tmp directory, it shows me /tmp/file_name: Permission denied. The same error is shown when I simply enter /tmp. The file system for /tmp is ramfs. I've tried chmod 777 /tmp/file_name but it returns the same error. ls -l /tmp shows -dwxr-xr-x before file_name. Running mount shows me:

rootfs on / type rootfs (rw)
/dev/root on / type squashfs (ro,relatime)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
ramfs on /tmp type ramfs (rw,relatime)
none on /dev type tmpfs (rw,relatime,size=512K)
devpts on /dev/pts type devpts (rw,relatime,mode=600)

I've tried mount -o remount,exec /tmp after which the output of mount did not change, and executing the program returned the same error. Running mount -o remount,noexec /tmp adds noexec to the ramfs line. Entering /proc, /sys or /dev also returns Permission denied.

Why is this happening and what should I do to execute the programs from /tmp? I'm doing this on a router running DD-WRT v24-sp2.

3
  • Should your tmp dir look like that? I would expect the sticky bit to be set.
    – Hennes
    Apr 11, 2015 at 14:17
  • Shouldn't I see a t in ls -l /tmp in that case? Apr 11, 2015 at 14:22
  • Yes. E.g. it could look like this: drwxrwxrwt 30 root wheel 6656 Apr 11 04:15 tmp (last perm. part is t).
    – Hennes
    Apr 11, 2015 at 14:25

0

You must log in to answer this question.

Browse other questions tagged .