[SOLVED] Linux MInt 16 MATE folder sharing doesn't work?

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
sourcefinder

[SOLVED] Linux MInt 16 MATE folder sharing doesn't work?

Post by sourcefinder »

I have Linux Mint 16 MATE 64 bit installed on 2 computers: An Intel Core 2 Quad Q9550 and an Intel Core i7 4770. Both systems have a second harddisk, formatted as NTFS. My problem is simple: I have tried to share the 2nd harddisks on both systems. Other systems (linux Mint MATE 13, Windows 7, Windows 8.1) can see the share, but can't access it. I tried the following steps:
1. experimented with the configuration file (/etc/samab/samba.conf)
2. installed and configured system-config-samba (sudo apt-get install samba system-config-samba cifs-utils winbin)
3. searched for comparable problems
But nothing seems to work.

I can also run Linux Mint 13 MATE on both systems (no dual-boot; seperated OS-harddisks, the same second harddisk). Sharing is nog problem with Mint 13 MATE. Regarding point 2: on a certain website a read that samba isn't installed by default. But installing it according to this point didn't bring me a solution. Has anyone got a solution for this problem? Looks to me like a bug!

In advance thanks for your reactions.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
altair4
Level 20
Level 20
Posts: 11458
Joined: Tue Feb 03, 2009 10:27 am

Re: Linux MInt 16 MATE folder sharing doesn't work?

Post by altair4 »

Pick one of these MATE16 machines and post the output of the following commands:

Code: Select all

testparm -s

Code: Select all

net usershare info --long

Code: Select all

hostname
And how are you mounting the ntfs partitions? fstab?

Note: You will likely not get any output from the usershsare command.

Side note: All Mint products have samba installed by default.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
sourcefinder

Re: Linux MInt 16 MATE folder sharing doesn't work?

Post by sourcefinder »

Hello Altair, I saw your name somewhere when browsing for this problem. Nice to hear from you.

Mounting ntfs partitions: My NTFS drive was just there (as it is by installing LM13); in LM16 I automounted it with the following commands:
1. sudo apt-get install ntfs-config
2. sudo mkdir -p /etc/hal/fdi/policy
Then I launched ntfs-config from the control panel and selected sdb1 for automount.

What occured to me is the fact that my NTFS drive is visible in LM13 under /media/sdb1. In LM16 the path is /media/q9550/data. Of course I selected the last path for sharing.

Second thing I noticed: In /etc/samba/samba.conf there are differences between LM13 and LM16:
- LM13: writable = yes --> LM16 writeable = yes
- LM13: browsable = yes --> LM 16 browseable = yes
Just before executing the commands as you are suggesting, I adjusted samba.conf in LM16 according to samba.conf in LM13 en restarted the system.

net usershare info --long gave no reply. Hostname: q9550-lmm16

testparm -s (notice: map to guest =bad user)!

Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[printers]"
Processing section "[print$]"
Processing section "[data]"
Loaded services file OK.
Server role: ROLE_STANDALONE
[global]
server string = %h server (Samba, Linux Mint)
map to guest = Bad User
obey pam restrictions = Yes
pam password change = Yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
unix password sync = Yes
syslog = 0
log file = /var/log/samba/log.%m
max log size = 1000
dns proxy = No
usershare allow guests = Yes
panic action = /usr/share/samba/panic-action %d
idmap config * : backend = tdb

[printers]
comment = All Printers
path = /var/spool/samba
create mask = 0700
printable = Yes
print ok = Yes
browseable = No

[print$]
comment = Printer Drivers
path = /var/lib/samba/printers

[data]
path = /media/q9550/data
read only = No
guest ok = Yes
altair4
Level 20
Level 20
Posts: 11458
Joined: Tue Feb 03, 2009 10:27 am

Re: Linux MInt 16 MATE folder sharing doesn't work?

Post by altair4 »

[data]
path = /media/q9550/data
read only = No
guest ok = Yes
Is "q9550" your user name?

If it is then change your share definition to this:
[data]
path = /media/q9550/data
read only = No
force user = q9550
guest ok = Yes
Then restart samba:

Code: Select all

sudo service smbd restart
Note: testparm is an interpreter so the share definition will have a lot of other options than what's displayed here. Tesparm thows them out since they are part of the defaults for all shares and so ignored. The important part is to add the force user line.

BTW: "map to guest = Bad User" has to be there. It converts remote users who do not have a samba password ( called a "Bad User" ) to the guest account.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
sourcefinder

Re: [SOLVED] Linux MInt 16 MATE folder sharing doesn't work?

Post by sourcefinder »

Altair4, your solution worked out of the box! When you where here in the Netherlands, I would definitly buy you a beer (or more)! Thanks for your help with this problem!

What I didn't get is the fact that samba.conf shows something else than testparm -s. Furthermore, I think that sharing folders should be working out of the box. But then, that is probably the reason why Mint releases LTS versions (very stable) and short release versions (less stable).

Regards,

sourcefinder
altair4
Level 20
Level 20
Posts: 11458
Joined: Tue Feb 03, 2009 10:27 am

Re: [SOLVED] Linux MInt 16 MATE folder sharing doesn't work?

Post by altair4 »

This has nothing to do with Samba. In fact it demonstrates the versatility of Samba to work around a problem caused by something else.

Back in the golden age of Linux udisks would mount these kinds of non-system partitions to /media/Something. The permissions on Something could be set and samba cound point to that folder and share it without incident.

They've over-engineered the plumbing since then and now the new improved udisks2 sets the mount point to /media/$USER/Something. Trouble is /media/$USER doesn't have normal Linux permissions ( it shows up as being owned by root ). Instead it's controlled by the system with an ACL ( Access Control List ) such that only $USER can pass that folder to get to Something. "force user" converts the guest user to $USER so he can access Something.

Had you mounted the partition where you had it in Mint13 - /media/data your smb.conf file would have worked out of the box.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
sourcefinder

Re: [SOLVED] Linux MInt 16 MATE folder sharing doesn't work?

Post by sourcefinder »

I understand your last comment, exept for the last part. I'm very tired right now (it's about 0.35 am in the Netherlands); tomorrow I will try to eveluate your comment an react on that.
altair4
Level 20
Level 20
Posts: 11458
Joined: Tue Feb 03, 2009 10:27 am

Re: [SOLVED] Linux MInt 16 MATE folder sharing doesn't work?

Post by altair4 »

Let me try it another way:

If your partition was mounted to /media/data instead of /media/q9550/data and your share pointed to /media/data:
[data]
path = /media/data
read only = No
guest ok = Yes
Then you wouldn't need "force user" since ntfs-cong sets permissions to 777 allowing everyone access not just q9550.

Although I'll admit it's been a while since I've seen ntfs-config being used. I thought it was purged from the repositories years ago.

The point I was making was this is all about Linux permissions not Samba.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
sourcefinder

Re: [SOLVED] Linux MInt 16 MATE folder sharing doesn't work?

Post by sourcefinder »

Ok,thanks for the explenation. Mint 16 mounts the second harddisk automaticly in /media/username/diskname. In MInt 13 it's mounted as /media/diskname.

My personal eveluation to get folders shared: I have tried a fresh install on both machines. The result: I have to use automount to automaticly mount ntfs harddisks (including the 2nd disk in my machines). After restarting linux, I can share folders in control panel - shared folders. At that moment, other machines won't see the share. So, the next thing to do is open /etc/samba/samba.conf as administrator and add the line force user = x (x is the username) to the share at the bottom of the file. Restart the machine and it's done.

Another (probably better way) is to mount the 2nd harddisk as /media/diskname, as you said. But even then you have to automount ntfs harddisks. What is the advantage? And, more important, how do you change this mounting location?
altair4
Level 20
Level 20
Posts: 11458
Joined: Tue Feb 03, 2009 10:27 am

Re: [SOLVED] Linux MInt 16 MATE folder sharing doesn't work?

Post by altair4 »

You are given an opportunity when you install Mint to have the ntfs partition or any other non-system partitions automatically mounted to wherever you specify - it's available when you use the "Something Else" option.

Anyway, If you already have this partition automatically mounted then you should have an entry in /etc/fstab. It's fstab the specifies the mount point. You can change it by:

** Creating a new folder to be used as the mount point: /media/data
** Unmount the currently mounted partition
** Change fstab to reflect the new mount point
** Then run "sudo mount -a" to see if it worked.

Since things seem to working for you as is I wouldn't bother with it.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
Locked

Return to “Networking”