Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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)

./initall.sh
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

2 Answers 2

up vote 2 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 2 days ago
    
@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 2 days ago
    
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 yesterday

You can always execute script with

sh ./your_script.sh

or

bash ./your_script.sh

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

share|improve this answer

Your Answer

 
discard

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.