Samba/CIFS is confusing, can sambady please help?

Connection sharing, Firewall, Samba..etc
Forum rules
Before you post please read this

Samba/CIFS is confusing, can sambady please help?

Postby Dutchie on Wed Mar 05, 2014 4:07 pm

Hi,

Pun intended in topic title. I've been using samba for some time, but now I've run into a situation where I'm confused as how to properly mount using the cifs protocol.

I use this mount command:
Code: Select all
sudo mount -t cifs -o username=someuser,gid=1001,rw,noperm //[IPADDRESS]/share /mnt/share


1001 is a newly created group on the computer hosting the folder called "stuff".

HOWEVER! ... When I "touch test" in the folder and "ls -la" on the hosting computer to see what user and group the file test belongs to, it's not a member of group, no no no. It's a member of someuser and the owner is someuser.

I want to mount the target folder in a way where, when I create files, the file will belong to someuser:stuff !

Can someone please please help me with this? I've out used google, nothing helpful came up -_- I've even forgotten what I allready tried. As far as I can remember, I've never been able to do this in a proper way.

Thanks!
Dutchie
Level 1
Level 1
 
Posts: 7
Joined: Fri Feb 21, 2014 10:19 am

Linux Mint is funded by ads and donations.
 

Re: Samba/CIFS is confusing, can sambady please help?

Postby altair4 on Wed Mar 05, 2014 4:26 pm

Just so I understand the issue:
HOWEVER! ... When I "touch test" in the folder and "ls -la" on the hosting computer to see what user and group the file test belongs to, it's not a member of group, no no no. It's a member of someuser and the owner is someuser.

If you are checking the permissions on the server they have nothing to do with how you mounted the share on the client.

The directory that is shared on the server either needs to have the setgid bit set ( like a 2775 ) and the group set to stuff or a "force group = stuff" added to the samba share definition. Or both.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 16
Level 16
 
Posts: 6044
Joined: Tue Feb 03, 2009 10:27 am

Re: Samba/CIFS is confusing, can sambady please help?

Postby filozofio on Tue Jun 03, 2014 9:22 am

Ok then better move the issue to other thread
Last edited by filozofio on Tue Jun 03, 2014 3:31 pm, edited 3 times in total.
User avatar
filozofio
Level 1
Level 1
 
Posts: 30
Joined: Thu Apr 14, 2011 2:31 am

Re: Samba/CIFS is confusing, can sambady please help?

Postby altair4 on Tue Jun 03, 2014 9:36 am

First of all the samba server package is already installed in every Mint release.

Second of all he is accessing a samba share not creating one so he doesn't need the samba package at all.

Third of all just leave the default smb.conf alone. It may not appear as true but someone has actually given this a wee bit of thought.

Forth of all if you do this in Cinnamon in combination with the share definition you created in smb,conf:
With nemo (cinnamon), caja or whatever your file manager program, you can easily change the permissions of a folder (say /home/username/Public), and tell the system to share it.

You just created 2 samba shares of the same folder:

** The one you created in smb.conf
** And the new one you created in /var/lib/samba/usershares.

It's generally not a good idea to use two different methods to create a samba share of the same folder.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 16
Level 16
 
Posts: 6044
Joined: Tue Feb 03, 2009 10:27 am

Re: Samba/CIFS is confusing, can sambady please help?

Postby filozofio on Tue Jun 03, 2014 9:49 am

Ok, then better move the issue to other thread
Last edited by filozofio on Tue Jun 03, 2014 3:30 pm, edited 1 time in total.
User avatar
filozofio
Level 1
Level 1
 
Posts: 30
Joined: Thu Apr 14, 2011 2:31 am

Re: Samba/CIFS is confusing, can sambady please help?

Postby altair4 on Tue Jun 03, 2014 10:07 am

I think there are not two methods in one. The smb.conf file is usually changed when you change the samba configuration.

Nope.

If I go to Nemo and right click my Public Folder and select "Sharing Options" and create the share:
SharingOptions.png

I will create a share definition not in smb.conf but here:
cat /var/lib/samba/usershares/public
#VERSION 2
path=/home/tester1/Public
comment=
usershare_acl=S-1-1-0:F
guest_ok=y
sharename=Public

It has it's owns settings and a different format from the one you would create in smb.conf which is one reason why you don't want to use both methods.

It's also generally not a good idea to keep using the same smb.conf file from release to release and especially between different distros. Eventually it will get you like when Mint17 is released and samba changes from Version3 to Version4.

Keep the default smb.conf and make small incremental changes if necessary depending on what you want to do. Here's a HowTo concerning browsing issues which as I recall make only 2 small changes to smb.conf: Samba Browsing Problems Checklist.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 16
Level 16
 
Posts: 6044
Joined: Tue Feb 03, 2009 10:27 am

Re: Samba/CIFS is confusing, can sambady please help?

Postby filozofio on Tue Jun 03, 2014 10:36 am

Ok, then better move the issue to other thread
Last edited by filozofio on Tue Jun 03, 2014 3:30 pm, edited 1 time in total.
User avatar
filozofio
Level 1
Level 1
 
Posts: 30
Joined: Thu Apr 14, 2011 2:31 am

Re: Samba/CIFS is confusing, can sambady please help?

Postby altair4 on Tue Jun 03, 2014 10:50 am

Nope. When I install a new distro ( like Mint17 for example ) I always check Samba first by creating a Usershare ( like the one nemo creates ) and accessing it from another machine.

It works by default. I made no changes at all to smb.conf. It's been doing that in my network through successive releases of Ubuntu, Mint, Debian, etc.. for years.

But we digress. None of this has anything to do with the original post. The original post has to do with permissions/ownership of newly created files on the remote share that he is accessing and may not have control over. Your post doesn't fix that.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 16
Level 16
 
Posts: 6044
Joined: Tue Feb 03, 2009 10:27 am

Linux Mint is funded by ads and donations.
 

Return to Other networking topics

Who is online

Users browsing this forum: No registered users and 1 guest