[SOLVED] LM9: Share my folder

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
SiKing
Level 5
Level 5
Posts: 571
Joined: Mon Sep 29, 2008 10:57 pm
Location: Las Vegas
Contact:

[SOLVED] LM9: Share my folder

Post by SiKing »

I used to have this problem with previous versions of LM, and I still have the exact same problem with LM9. All the following is in LM9:
1. Open Nautilus, and go to my home folder.
2. Right click on the Public folder, and select Sharing options.
3. Turn on Share this folder. I am prompted to install the sharing package (I assume this means Samba); so I do that. I then have to restart my session, so I reboot just to be sure.
4. Go to the Sharing options for the same folder again, and turn on Share this folder.
5. Also turn on Guest access.
6. Back in Nautilus, navigate to Network > my computer > public. When I double click on public, I get: "Unable to mount location. Failed to mount Windows share."
Exact same thing happens when browsing from any other computer to my share, Windows or Linux, on my network. I have never configured Samba by hand. What am I doing wrong?
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.
fwc

Re: LM9: Share my folder

Post by fwc »

It sounds like your drives aren't mounted in the first place. You should learn to edit your fstab in /etc so you can mount your disks on startup if you don't know how already. If you post your "fstab -l" it may help fix the problem also.
SiKing
Level 5
Level 5
Posts: 571
Joined: Mon Sep 29, 2008 10:57 pm
Location: Las Vegas
Contact:

Re: LM9: Share my folder

Post by SiKing »

What? I am not mounting any drives. I am trying to share one folder (~/Public) on a disk that is already mounted to other machines on the network.
vincent

Re: LM9: Share my folder

Post by vincent »

Ummm...perhaps it's a permissions issue?

Code: Select all

chmod -R 777 ~/Public
fwc

Re: LM9: Share my folder

Post by fwc »

SiKing wrote:What? I am not mounting any drives. I am trying to share one folder (~/Public) on a disk that is already mounted to other machines on the network.
Sorry, I misread your 6th point. I was just scanning a little too fast.
rhodry
Level 4
Level 4
Posts: 343
Joined: Mon Jun 04, 2007 7:32 am

Re: LM9: Share my folder

Post by rhodry »

I am not sure but I don't think the "right click - share this folder" form of personal sharing is in fact Samba. If it is, I think it is some cut-down version. I still setup Samba shares the old fashioned "edit the setup files" way and have never had a failed setup across many many mixed systems. That's what comes from "dumbing" down the interface at every turn :) (I'm only half joking :roll: )

In any case, can you open a terminal and post the result of this command:

$ smbclient -L 127.0.0.1

This will show us what shares you currently have setup in Samba.

Cheers,
Rhodry.
Life isn't about waiting for the storm to pass...
it's about learning to dance in the rain.
altair4
Level 20
Level 20
Posts: 11458
Joined: Tue Feb 03, 2009 10:27 am

Re: LM9: Share my folder

Post by altair4 »

rhodry wrote:I am not sure but I don't think the "right click - share this folder" form of personal sharing is in fact Samba. If it is, I think it is some cut-down version. Rhodry.
"Nautilus > Right Click > Share this folder" is called Nautilus-share ( or usershares ). It is in fact Samba. It's been part of Samba for several years now. The big difference between Nautilus-share and what is now refered to as Classic-share is that share definitions are in /var/lib/samba/usershares not in smb.conf. It's purpose is to allow a user ( i.e., they do not have to become root ) to share any folder they own.

SiKing,

I would go through a couple of checks.

(1) If you've not touched the mint firewall then you're fine. If you have modified it then disable it.

(2) Make sure samba and it's cousin are running:

In a Terminal:

sudo service smbd restart
sudo service nmbd restart

(3) Make sure your netbios name is 15 characters or less. Samba will default to the machine name so your netbios name is going to be what appears after the "@" when you open a Terminal. If it is more than 15 there's an easy fix using Samba itself.

(4) Just in case there is a conflict with Nautilus-share and Classic-share post the output of the following commands:

net usershare info
testparm -s
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
SiKing
Level 5
Level 5
Posts: 571
Joined: Mon Sep 29, 2008 10:57 pm
Location: Las Vegas
Contact:

Re: LM9: Share my folder

Post by SiKing »

I guess I should have quantified my answer somewhat:
Although I do not know how to set up Samba, it is not out the realm of possibility for me to Google how to set it up manually. What is more important is: Am I expecting too much out of the "Share this folder" option in Nautilus? Am I using it wrong? Is this a bug in U10.04/LM9?

I will go through altair's suggestions when I get home tonight, and post back the results...
altair4
Level 20
Level 20
Posts: 11458
Joined: Tue Feb 03, 2009 10:27 am

Re: LM9: Share my folder

Post by altair4 »

You are attempting to share a file you own and you are allowing guest access with full read write permissions. This is one of those conditions that the samba gods created Nautilus-share.

If you created the share from /home/username/Public, open up a terminal and type: net usershare info

This is what you should get - and I mean exactly this - no deviation:
[public]
path=/home/username/Public
comment=
usershare_acl=Everyone:F,
guest_ok=y
EDIT: I may have read more into your original post than you actually stated. If you did not allow others to write to the share then the 3rd line would look like this:
usershare_acl=Everyone:R,
If you do an ls -dl /home/username/Public, you should get this because Nautilus-share automatically modifies permissions to match the share definition:
drwxrwxrwx 2 username username
If you have that share definition and those permissions you should be good to go.

The things that prevent that from happening ( in general ) are firewalls, conflict with classic-samba, netbios name length, services not running, or netbios name resolution. Other than the conflict with using classic and nautilus sharing at the same time, all of these problem will prevent samba from functioning regardless of what samba method you're using.

Netbios name resolution is when the client OS cannot convert an ip address ( which it can see ) to the netbios name ( which it may not be able to see ). The solution to this can be very simple or very complicated. Hopefully it's something other than that.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
SiKing
Level 5
Level 5
Posts: 571
Joined: Mon Sep 29, 2008 10:57 pm
Location: Las Vegas
Contact:

Re: LM9: Share my folder

Post by SiKing »

rhodry wrote:In any case, can you open a terminal and post the result of this command:

$ smbclient -L 127.0.0.1

This will show us what shares you currently have setup in Samba.

Code: Select all

Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.4.7]

	Sharename       Type      Comment
	---------       ----      -------
	print$          Disk      Printer Drivers
	IPC$            IPC       IPC Service (iotal server (Samba, LinuxMint))
	public          Disk      Mark's shared stuff
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.4.7]

	Server               Comment
	---------            -------
	IOTAL                iotal server (Samba, LinuxMint)

	Workgroup            Master
	---------            -------
	WORKGROUP            IOTAL
SiKing
Level 5
Level 5
Posts: 571
Joined: Mon Sep 29, 2008 10:57 pm
Location: Las Vegas
Contact:

Re: LM9: Share my folder

Post by SiKing »

altair4 wrote:(1) If you've not touched the mint firewall then you're fine. If you have modified it then disable it.
Didn't touch it, so check.
altair4 wrote:(2) Make sure samba and it's cousin are running:

In a Terminal:

sudo service smbd restart
sudo service nmbd restart
Check!
altair4 wrote:(3) Make sure your netbios name is 15 characters or less. Samba will default to the machine name so your netbios name is going to be what appears after the "@" when you open a Terminal. If it is more than 15 there's an easy fix using Samba itself.
Check!
altair4 wrote:(4) Just in case there is a conflict with Nautilus-share and Classic-share post the output of the following commands:

net usershare info

Code: Select all

[public]
path=/home/mark/Public
comment=Mark's shared stuff
usershare_acl=Everyone:R,
guest_ok=y
altair4 wrote:testparm -s

Code: Select all

Load smb config files from /etc/samba/smb.conf
rlimit_max: rlimit_max (1024) below minimum Windows limit (16384)
Processing section "[printers]"
Processing section "[print$]"
Loaded services file OK.
Server role: ROLE_STANDALONE
[global]
	server string = %h server (Samba, LinuxMint)
	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

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

[print$]
	comment = Printer Drivers
	path = /var/lib/samba/printers
So what does all this mean?
SiKing
Level 5
Level 5
Posts: 571
Joined: Mon Sep 29, 2008 10:57 pm
Location: Las Vegas
Contact:

Re: LM9: Share my folder

Post by SiKing »

altair4 wrote:EDIT: I may have read more into your original post than you actually stated. If you did not allow others to write to the share then the 3rd line would look like this:
usershare_acl=Everyone:R,
Right, so I have that.
altair4 wrote:If you do an ls -dl /home/username/Public, you should get this because Nautilus-share automatically modifies permissions to match the share definition:
drwxrwxrwx 2 username username
Don't got that! None of the original permissions got changed, I have drwxr-xr-x, but isn't that correct considering I only want read-access for others?
In any case, I forced it with chmod -R 777 ~/Public, and I still cannot connect to it via smb:
:(
altair4 wrote:Netbios name resolution is when the client OS cannot convert an ip address ( which it can see ) to the netbios name ( which it may not be able to see ). The solution to this can be very simple or very complicated. Hopefully it's something other than that.
So now what? Is there a point in filing this as a bug at this stage?

Hey, and thanx for all your help!
altair4
Level 20
Level 20
Posts: 11458
Joined: Tue Feb 03, 2009 10:27 am

Re: LM9: Share my folder

Post by altair4 »

Sorry for not getting back sooner. Had a minor medical emergency here.

I have tried to reproduce your problem on my working network by doing terrible things to it and I have found only one circumstance that will produce the "Unable to mount location. Failed to mount Windows share" message both on the server with the share and from a remote samba client ( given the other conditions in your original post ). The problem is I doubt very seriously that you have this condition.

A samba client will not be able to access a remote share unless the read and execute bits are turned on along the entire path to the share. So for a share at /home/altair/Public:

If

Code: Select all

ls -dl /home/altair
produces
drwxr-x---
Then you will get that error.

If it's the default value:
drwxr-xr-x
Then it will not.

By default your home folder would have been set up with these bits enabled so you would have had to change them yourself and I don't know why you would have done that. Your share definition and share permissions are just as they should be. At the moment this is the best I've got.

In the unlikely event that you have the condition I presented then you need to return your home folder to it's default state:

Code: Select all

chmod 0755 /home/mark
or just go into Nautilus > Property > Permissions > and for others : Access Files
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
SiKing
Level 5
Level 5
Posts: 571
Joined: Mon Sep 29, 2008 10:57 pm
Location: Las Vegas
Contact:

Re: LM9: Share my folder

Post by SiKing »

altair4 wrote:By default your home folder would have been set up with these bits enabled so you would have had to change them yourself and I don't know why you would have done that.
:oops: because I'm paranoid?

So would this be considered a bug or user error? In other words: if I file this as a bug, are they going to laugh at me or actually seriously consider it?

Either way, thanx for all the help!
altair4
Level 20
Level 20
Posts: 11458
Joined: Tue Feb 03, 2009 10:27 am

Re: [SOLVED] LM9: Share my folder

Post by altair4 »

It's not so much a bug and if it were a bug it's more a bug in how linux file systems work not in samba. You're allowing guest access in samba. This translates to "others" in the linux file system. You turned access to others off in the path leading to the folder you want to share. The remote user can't get there.

There are a couple of other options available if you want to keep your home folder at mode = 0750 ( i.e., drwxr-x--- ).

(1) You could add a line in the [global] section of /etc/samba/smb.conf:

Code: Select all

force user = mark
What "force user" does is act as mask that converts the remote users identity to you as far as your share is concerned. Even though it sees the remote user as you, samba still has a gatekeeper capacity to limit what "you" can do. So even though you can read and write to the folder locally, if you have write turned off in samba the remote user will be limited to read only.

(2) You could also do a variation of this:

Code: Select all

force group = mark
Right now "Public"'s parent folder /home/mark have permissions set to allow group "mark" to read only. When the guest is allowed access by samba it will be converted to group "mark" and will then find the path to Public.

If you try any of these options remember to restart samba after editing smb.conf: sudo service smbd restart
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
SiKing
Level 5
Level 5
Posts: 571
Joined: Mon Sep 29, 2008 10:57 pm
Location: Las Vegas
Contact:

Re: [SOLVED] LM9: Share my folder

Post by SiKing »

OK. Thanx a lot for everything!
Locked

Return to “Networking”