I'm using Fedora 17 too and I can run scripts over a Samba share mounted with mount -t cifs -o guest //ntinstall...tld/superuser /mnt/cifs/superuser. As for the permissions, the original looks like -rwxr-xr-x. 1 root root 41 Aug 19 06:28 /srv/superuser/script1.py and the mounted one like -rwxr-xr-x. 1 root root 41 Aug 19 06:28 /mnt/cifs/superuser/script1.py. I'm using samba-3.6.6-92.fc17.1.i686 for the server and cifs-utils-5.6-1.fc17.i686 for the client, along with kernel-PAE-3.5.2-1.fc17.i686.
–
Cristian CiupituAug 19 '12 at 3:34

2 Answers
2

I would not use samba to connect two linux machines. Samba is designed to let linux/unix machines communicate with windows and vice versa. NFS is much better for two linux machines. You can probably tweak the samba settings to allow you to execute scripts, but you really will be better off using a native linux method. On my system, I have the same directory exported using samba (for the windows on my home network) and nfs for the linux and OSXes.

To export a directory using nfs, first, on both server and client, install autofs5 and nfs-common (the autofs is used to automatically mount/unmount the share as explained below). On the server, install nfs-kernel-server.

Then (all these commands should be run as root):

Create the directory you will export, eg /nfs_shares:

sudo mkdir /nfs_shares

Set up the export rules. On the server, edit /etc/exports and add these lines:

/nfs_shares 192.168.0.XX(rw,sync,no_subtree_check)

Where 192.168.0.XX is the client's (your Ubuntu Desktop) IP.

Mount (bind) the directory you will export to this new location. First add this line to /etc/fstab:

/path/to/exported/homeshare /nfs_shares bind bind 0

Then, mount it:

mount /nfs_shares

On the client, create the directory where you will mount the share (e.g. /mnt/homeshare):

mkdir /mnt/homeshare

At this point you should be able to manually mount the share. On the client:

mount -t nfs 192.168.0.XX:/nfs_shares/ /mnt/homeshare

Now, lets automate. On the client, create a file called /etc/auto.master with these lines (change SERVERNAME to whatever you want to call it):

+auto.master
/mnt/homeshare /etc/auto.SERVERNAME --timeout 60 --ghost

On the client, create a file called /etc/auto.SERVERNAME (change SERVERNAME to whatever you used in step 4) with these lines (you can use the server's network name or IP if static, change the XXs for whatever is your server's IP):

Run it! On the server, run service nfs-kernel-server restart and on the client run service nfs-common restart; service autofs restart

So, this makes it so the share is mounted automatically. If it is incative for one minute it will be unmounted and remounted as soon as you try to access it (eg ls /mnt/homeshare). Make sure you set the permissions the way you need them (chmod) for the directories you use.

@James Hang on, do you get the permission error when you try to mount or when you try to access the mounted share? Is netb the name of the fedora server? Have you tried mounting using the server's IP instead?
–
terdonAug 18 '12 at 15:35

netb was ubuntu 12 but I installed fedora 17 minimal. I was getting the error when I tried to list the directory. The UID and GID didnt match as it was a directory in a home directory so have sorted that now. Its working and tomorrow I'm gonna set up the auto part. Thanks for you help.
–
JamesAug 18 '12 at 23:38

@James You're very welcome, glad to hear you sorted it out. And +1 for figuring out the /etc/exports bit. I had forgotten that step, sorry, I've now updated my answer to include it.
–
terdonAug 19 '12 at 3:05

If you don't care too much about performance and some quirks, there's also the option of using SSHFS.

With Nautilus it's very easy. Go to File, Connect to Server..., select SSH as the type, fill in the details and that's it. The share will be mounted under /run/user/james/gvfs/. To unmount it, go to Computer in Nautilus, right click the share and select Unmount.