# Symlinks and permissions on mount_smbfs



## mrgz (May 3, 2010)

Hi,

I'm having a problem mounting linux shares on FreeBSD with mount_smbfs. They are not following (linux) symlinks and all permissions are reseted to 755.

Is there a way to make smbfs understand correctly those properties?

Tks,


----------



## SirDice (May 3, 2010)

You might want to read the mount_smbfs(8) man page:


> *-f mode, -d mode*
> Specify permissions that should be assigned to files and directories.  The values must be specified as octal numbers.  Default value for the file mode is taken from mount point, default value for the directory mode adds execute permission where the file mode gives read permission.
> 
> Note that these permissions can differ from the rights granted by SMB server.





> Is there a way to make smbfs understand correctly those properties?


Not with mount_smbfs, no. 

Why don't you use NFS?


----------



## mrgz (May 3, 2010)

Yes, I'll try NFS. I've also tried sshfs, but it's not working with linux binaries, as I pointed on a previous post.

Thanks for the reply


----------



## SirDice (May 3, 2010)

NFS is really easy to set up and use. The only caveat is that you have to make sure the user and group IDs are the same for all machines. Strickly speaking they don't have to be, NFS will work fine nonetheless. It'll only make it confusing if UID 1000 is UserA on one machine and UserB on another.


----------



## mrgz (May 3, 2010)

*NFS working!*

Yes, now it works! It's really very easy. 

Good that you told me about the permissions. My user on BSD was 1001 and on the remote machines, 1000. Changed with pw command and everything is fine now, from symlinks to permissions. Even with the linux binaries. :e

And an extra issue: For curiosity, I've tried to mount sshfs after changing the uid to see what happens. Linux compat /usr/compat/linux/bin/ls  command started to list directories, but with an "Invalid argument" printed before the output. I'll keep in touch if I discover more details about this bug.

Thanks a lot!!


----------

