LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (https://www.linuxquestions.org/questions/red-hat-31/)
-   -   In redhat, if you change the fstab, do you have to sync it or something? (https://www.linuxquestions.org/questions/red-hat-31/in-redhat-if-you-change-the-fstab-do-you-have-to-sync-it-or-something-689927/)

soylentgreen 12-11-2008 05:42 PM

In redhat, if you change the fstab, do you have to sync it or something?
 
I have a redhat box that I am mounting a samba share.

I need to have read/write access for a user (that is in the group 'user'). The original /etc/fstab had

//IP/exchange /mount/point/ smbfs username=username,password=password 0 0

I changed it to
//IP/exchange /mount/point/ smbfs credentials=/root/.smbcred,gid=user 0 0



is my syntax 'correct' in order for the user in the group 'user' to be able to have read/write access to the share?

Thanks in advance for your advice

custangro 12-11-2008 05:52 PM

Quote:

Originally Posted by soylentgreen (Post 3372312)
I have a redhat box that I am mounting a samba share.

I need to have read/write access for a user (that is in the group 'user'). The original /etc/fstab had

//IP/exchange /mount/point/ smbfs username=username,password=password 0 0

I changed it to
//IP/exchange /mount/point/ smbfs credentials=/root/.smbcred,gid=user 0 0

but it seems to be mounting the old way.

Two questions:
1) do I need to 'resync' the fstab or something to get it to read the line the 'new' way?

2) is my syntax 'correct' in order for the user in the group 'user' to be able to have read/write access to the share?

Thanks in advance for your advice

It's hard to tell with your "generic" example. Can you post your real fstab.


-C

billymayday 12-11-2008 06:00 PM

Have you rebooted and/or umounted/remounted?

Apologies in advance if that's insultingly obvious.

jschiwal 12-11-2008 06:08 PM

The smbfs filesystem is obsolete and not included in newer kernels. Use cifs instead. That has better support for Linux permissions including acls. If the server doesn't support cifs, then the uid, gid, file_mask and dir_mask options are fallback options. I noticed that your fstab options don't include the file_mode & dir_mode options or the uid or gid options. You can use either the numeric or text values for the user & group options (uid= & gid=).

On the server side, the person or group member accessing the share also need permission to access the directory being shared. If you are mounting the share with "gid=users", then the group owner of the directory being shared should be "users" or "others" should have write permissions.

Also, there are different password backends that you might be using. The default security mode is "security = user", with user account information contained in the smbpasswd file. If this is the case, users should be Linux users on a samba server, and should have their usernames and passwords entered using the smbpasswd file. You might use ldap or a password database backend instead.

If you made changes in the server, then you need to restart the samba service on the server. The nmbd service could be restarted on the client.

Changing the fstab entry to use a credentials file was the right thing to do. Otherwise any user on that client would be able to read the password.

soylentgreen 12-11-2008 08:11 PM

I changed it to:

//10.0.10.89/exchange /usr/graphicStore1/ cifs credentials=/root/.smbcred,uid=graphics,file_mode=0777,dir_mode=0777 0 0

the share mounted, but no read/write for the user 'graphics'

then I tried:

//10.0.10.89/exchange /usr/graphicStore1/ cifs credentials=/root/.smbcred,gid=100,file_mode=0777,dir_mode=0777 0 0

and that didn't work either.

The windows boxes can read/write to the share fine. I can also read/write as root no problem, but I cannot read/write as the user 'graphics' (who is in the group 'users' which is gid 100).

yes, i have umounted / mounted the share after each time.

the 'mount' command shows:

//10.0.10.89/exchange on /usr/graphicStore1 type cifs (rw,mand)

edit: for the record, the share is hosted on a FreeBSD box with SAMBA 3.0.32, and has been of no issue with any other machines than this one.

Thank you again for your responses, any ideas?

jailbait 12-11-2008 09:26 PM

Quote:

Originally Posted by soylentgreen (Post 3372312)

1) do I need to 'resync' the fstab or something to get it to read the line the 'new' way?

Yes. /etc/fstab is read and executed at boot. If you make changes to /etc/fstab they will not take effect automatically until the next boot.

If you want your changes to /etc/fstab to take effect immediately then you should issue a mount -a command. Read about the mount command in the mount man pages before you try a mount -a.

-------------------
Steve Stites

custangro 12-11-2008 09:38 PM

Quote:

Originally Posted by jailbait (Post 3372467)
Yes. /etc/fstab is read and executed at boot. If you make changes to /etc/fstab they will not take effect automatically until the next boot.

If you want your changes to /etc/fstab to take effect immediately then you should issue a mount -a command. Read about the mount command in the mount man pages before you try a mount -a.

-------------------
Steve Stites

Also a mount -o remount /mount/point would work too.

-C

soylentgreen 12-12-2008 07:39 AM

Quote:

Originally Posted by jailbait (Post 3372467)
Yes. /etc/fstab is read and executed at boot. If you make changes to /etc/fstab they will not take effect automatically until the next boot.

If you want your changes to /etc/fstab to take effect immediately then you should issue a mount -a command. Read about the mount command in the mount man pages before you try a mount -a.

-------------------
Steve Stites

I appreciate your response; we are kind of past that part now. I was asking specifically about Red Hat, not fstab in general.

Perhaps you didn't see the part where I stated that I have re-mounted the share -several- times, with no read / write for the user.

Now the question is the syntax, and why the user is unable to read/write.

soylentgreen 12-12-2008 09:15 AM

I have also tried taking out the gid / uid and using simply:

//10.0.10.89/exchange /usr/graphicStore1 cifs credentials=/root/.smbcred,file_mode=0777,dir_mode=0777 0 0

but no non-root user can read/write.

Does anyone know where I'm going wrong?

lazlow 12-12-2008 04:54 PM

Have you verified that the user has write permissions to the mount pt? This is separate from the samba/cifs permissions.

soylentgreen 12-12-2008 07:15 PM

Quote:

Originally Posted by lazlow (Post 3373516)
Have you verified that the user has write permissions to the mount pt? This is separate from the samba/cifs permissions.

Thank you kind sir, may I buy you a donut?

That was it. I was so wrapped up in the share permission, I hadn't checked the mount point.


All times are GMT -5. The time now is 10:07 AM.