Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a remote mount with cifs and it would seem there is no way to have bash execute scripts from that mount, is it possible to enable such execution?

ls -lh ini*
-rwxrwxr-x 1 alan 500 222 2012-03-23 10:16 initall.sh

bash --version
GNU bash, version 4.2.8(1)-release (i686-pc-linux-gnu)

bash: ./initall.sh: Permission denied

The cifs mount seems to support also unix extensions as I am able to chmod the file correctly.

Here follows the mount options: user,auto,pass=***,uid=alan,user=***

share|improve this question
up vote 4 down vote accepted

The user mount option turns off exec by default. Change the mount options to include exec explicitly.

share|improve this answer
This only worked on the command line. If I put 'exec' in the options list of /etc/fstab, it doesn't work. Strange. – Michael R. Hines Aug 27 '14 at 5:12
@MichaelR.Hines exec works the same in fstab and on the mount command line. If it didn't work for you, it's because of some specific circumstance (there's a different matching fstab entry, the filesystem was already mounted before, …) – Gilles Aug 27 '14 at 7:52
I'm pretty sure Ubuntu is screwing something up. I very clearly added a new line to /etc/fstab followed by "mount -a", followed by examiniming the mtab and the mount command is definitely not respecting what I put into the file. – Michael R. Hines Aug 28 '14 at 1:06

You can always execute script with

sh ./your_script.sh


bash ./your_script.sh

or whatever shell you use. It works even noexec mount option turned on.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.