Networking issue: LMDE refuses to create share in home

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

Networking issue: LMDE refuses to create share in home

Postby ckosloff on Mon Mar 14, 2011 10:09 pm

I have two Mint computers:
A has Julia 64-bit.
B has Debian Edition 32-bit.
I want to share files across these two computers.
Both have open-ssh, sshfs, samba (server and client), and nautilus-share installed.
I have no problem creating a share in my home directory in computer A with main edition.
However, computer B refuses to create a share in my home directory, saying that I lack permissions.
I can create share as root but this share is not shown under my profile.
I have the same user on both computers (ckosloff).
I am trying to connect to A from B via ssh, but no luck.
I would rather connect via samba, because there are Windows computers on my network, but for the moment I could settle to make the two Linux boxes talk to each other.
I'll tackle the other problem later, please help.
ckosloff
Level 3
Level 3
 
Posts: 151
Joined: Tue Jul 21, 2009 8:54 pm

Linux Mint is funded by ads and donations.
 

Re: Networking issue: LMDE refuses to create share in home

Postby CiaW on Tue Mar 15, 2011 11:47 am

I know there have been threads about this, personally I use NFS for my occasional file sharing with my laptop. I did a forum search for file sharing lmde and came upon this that should be helpful:

viewtopic.php?f=150&t=65713&p=382386

The bottom post mentions additional steps that are needed for LMDE. If you're just sharing with Linux and not Win and want to use NFS instead (I didn't want to learn to configure samba for linux sharing...) this was very helpful for me:
https://help.ubuntu.com/community/SettingUpNFSHowTo
CiaW
Level 3
Level 3
 
Posts: 170
Joined: Fri Sep 10, 2010 11:39 am
Location: Spokane Wash, USA

Re: Networking issue: LMDE refuses to create share in home

Postby altair4 on Tue Mar 15, 2011 12:48 pm

From Simple File Sharing in Mint: viewtopic.php?f=42&t=23169
Linux Mint Debian Edition Preliminary Steps

Step 1: "Guest Access" option is disabled by default. To enable it:

Open smb.conf as root:
Code: Select all
gksu gedit /etc/samba/smb.conf

Add the following lines to the [global] section:
Code: Select all
usershare allow guests = yes

Code: Select all
map to guest = Bad user

And restart samba:
Code: Select all
sudo service samba restart


Step 2: You do not have permissions to create a usershare because you are not included in the correct group.
Code: Select all
sudo gpasswd -a your_user_name sambashare


Step 3: Add samba client packages
Code: Select all
sudo apt-get install gvfs-fuse
sudo apt-get install libsmbclient
sudo apt-get install smbclient
sudo apt-get install python-smbc

Then add yourself to the fuse group:
Code: Select all
sudo gpasswd -a your-user-name fuse


Step 4: Logoff and Login again for all the group changes to take affect
Last edited by altair4 on Tue Mar 15, 2011 1:47 pm, edited 1 time in total.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 15
Level 15
 
Posts: 5817
Joined: Tue Feb 03, 2009 10:27 am

Re: Networking issue: LMDE refuses to create share in home

Postby altair4 on Tue Mar 15, 2011 1:29 pm

Just noticed this in your original post:
I have the same user on both computers (ckosloff).

Linux Mint Debian's smb.conf has the old [homes] section enabled. It's not browseable like a normal share because it's created "on the fly" the moment the remote user asks for it. It uses the [homes] share definition as a template and creates a share of that users home directory at that moment. Since you have the same user on both machines this may be the only situation where it makes sense to add a samba password for yourself and have remote access to your entire home directory:
Code: Select all
sudo smbpasswd -a ckosloff

Like I said above it's not browseable from another Linux box like other shares so you can only access it by specifying it by user name:
Code: Select all
nautilus smb://server/user-name

For example:
Code: Select all
nautilus smb://192.168.0.100/ckosloff

That may be a little too much sharing but I thought I would point that out. I'm not a fan of the admin user creating an smbpasswd for himself ( privacy / security issues ) but in this unique case it might make sense.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 15
Level 15
 
Posts: 5817
Joined: Tue Feb 03, 2009 10:27 am

Re: Networking issue: LMDE refuses to create share in home

Postby ckosloff on Wed Mar 16, 2011 5:13 pm

altair,
I see that you are a guru helping many people around.
I am working on your writings as time permits.
I prefer to digest everything thoroughly before messing up my system.
So, problem is not yet solved, give me a couple days, I might be back with more questions.
Thank you.
ckosloff
Level 3
Level 3
 
Posts: 151
Joined: Tue Jul 21, 2009 8:54 pm

Re: Networking issue: LMDE refuses to create share in home

Postby ckosloff on Wed Mar 16, 2011 7:32 pm

Followed all instructions on computer B with LMDE.
Attempted to connect from computer A with Julia main edition.
Error is
Could not display "smb://192.168.0.116/ckosloff/".
Error: Failed to mount Windows share
Please select another viewer and try again.
192.168.0.116 is the present IP of computer B, assigned by DHCP.
ckosloff
Level 3
Level 3
 
Posts: 151
Joined: Tue Jul 21, 2009 8:54 pm

Re: Networking issue: LMDE refuses to create share in home

Postby ckosloff on Thu Mar 17, 2011 5:42 am

Nautilus in LMDE still refuses to create share.
'net usershare' returned error 255: net usershare add: failed to add share debshare. Error was Operation not permitted
I am really at a loss, please help.
ckosloff
Level 3
Level 3
 
Posts: 151
Joined: Tue Jul 21, 2009 8:54 pm

Re: Networking issue: LMDE refuses to create share in home

Postby altair4 on Thu Mar 17, 2011 6:43 am

You've got 2 problems here:
Could not display "smb://192.168.0.116/ckosloff/".
Error: Failed to mount Windows share

On 192.168.0.116 make sure samba is running:
Code: Select all
sudo service samba restart

And, If you have enabled the firewall disable it.

Nautilus in LMDE still refuses to create share.

Please post the output of the following commands:
Code: Select all
net usershare info --long
testparm -s
groups

Also these:
Code: Select all
ls -al /path/to/debshare
ls -dl /var/lib/samba/usershares
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 15
Level 15
 
Posts: 5817
Joined: Tue Feb 03, 2009 10:27 am

Re: Networking issue: LMDE refuses to create share in home

Postby ckosloff on Thu Mar 17, 2011 2:31 pm

Code: Select all
ckosloff@lmde10 ~ $ net usershare info --long
[debshare]
path=/home/ckosloff/Debshare
comment=
usershare_acl=Everyone:F,
guest_ok=n


Code: Select all
ckosloff@lmde10 ~ $ testparm -s
Load smb config files from /etc/samba/smb.conf
rlimit_max: rlimit_max (1024) below minimum Windows limit (16384)
Processing section "[homes]"
Processing section "[printers]"
Processing section "[print$]"
Loaded services file OK.
Server role: ROLE_STANDALONE
[global]
   workgroup = POMPANO
   server string = %h server
   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

[homes]
   comment = Home Directories
   valid users = %S
   create mask = 0700
   directory mask = 0700
   browseable = No

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

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


Code: Select all
ckosloff@lmde10 ~ $ groups
ckosloff sudo fuse sambashare


Code: Select all
ckosloff@lmde10 ~ $ ls -al /path/to/debshare
ls: cannot access /path/to/debshare: No such file or directory


Code: Select all
ckosloff@lmde10 ~ $ ls -al /path/to/Debshare
ls: cannot access /path/to/Debshare: No such file or directory


Code: Select all
ckosloff@lmde10 ~ $ ls -dl /var/lib/samba/usershares
drwxrwx--T 2 root sambashare 4096 Mar 17 05:40 /var/lib/samba/usershares


altair,
Thanks for continuing support.
Followed all instructions to the letter.
Just one question for the moment: there is a command that will list all running processes, please refresh my dull memory.
ckosloff
Level 3
Level 3
 
Posts: 151
Joined: Tue Jul 21, 2009 8:54 pm

Re: Networking issue: LMDE refuses to create share in home

Postby altair4 on Thu Mar 17, 2011 3:19 pm

I hate to tell you this but everything looks right.

[1] There is one thing that's my fault because I didn't explain it very well:
ckosloff@lmde10 ~ $ ls -al /path/to/Debshare
ls: cannot access /path/to/Debshare: No such file or directory

You did exactly what I said to do but not what I meant you to do. This is what I was after:
Code: Select all
ls -al /home/ckosloff/Debshare

I just want to make sure that ownership and permissions are correct for the shared folder and it's parent folder.

[2] The other thing is rather confusing. From your previous post:
Nautilus in LMDE still refuses to create share.
'net usershare' returned error 255: net usershare add: failed to add share debshare. Error was Operation not permitted

And yet you created the share successfully:
net usershare info --long
[debshare]
path=/home/ckosloff/Debshare
comment=
usershare_acl=Everyone:F,
guest_ok=n

That's going to require a username and password to access but it should still be visible from the other machines on the network. Are you still getting an error?

[3] Can LMDE see it's own share. You can test that by running the following command:
Code: Select all
smbtree

EDIT: Sorry, didn't answer your last question.
to check the status of all the services:
Code: Select all
sudo service --status-all

To check the status of a specific service:
Code: Select all
sudo service name-of-service status

For example: sudo service samba status
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 15
Level 15
 
Posts: 5817
Joined: Tue Feb 03, 2009 10:27 am

Re: Networking issue: LMDE refuses to create share in home

Postby ckosloff on Thu Mar 17, 2011 4:59 pm

Code: Select all
ckosloff@lmde10 ~ $ ls -al /home/ckosloff/Debshare
total 20
drwxrwxrwx  2 ckosloff ckosloff 4096 Mar 13 22:41 .
drwxr-xr-x 34 ckosloff ckosloff 4096 Mar 17 13:28 ..
-rw-r--r--  1 ckosloff ckosloff 9171 Feb 20 22:56 address bar.odt
ckosloff@lmde10 ~ $ smbtree
Enter ckosloff's password:
WORKGROUP
POMPANO
   \\TNACH                Smilodon
cli_start_connection: failed to connect to TNACH<20> (0.0.0.0). Error NT_STATUS_UNSUCCESSFUL
   \\LMDE10               lmde10 server
      \\LMDE10\debshare          
      \\LMDE10\ckosloff          Home Directories
      \\LMDE10\Print_to_PDF      Print to a PDF File
      \\LMDE10\IPC$              IPC Service (lmde10 server)
      \\LMDE10\print$            Printer Drivers


I created the share as root, however it does not show up in Nautilus under my profile as shared, just as a directory.
It does show up shared to root.
Something is happening though, because POMPANO is the name of the Windows workgroup and TNACH is a machine in that workgroup that is turned on.
ckosloff
Level 3
Level 3
 
Posts: 151
Joined: Tue Jul 21, 2009 8:54 pm

Re: Networking issue: LMDE refuses to create share in home

Postby ckosloff on Thu Mar 17, 2011 5:09 pm

Posted from computer A (Julia 64-bit main edition).
Success!
I could connect to LMDE and see all my home directory, not just debshare.
It asked for my password, and it went straight through.
I noticed however that it said Workgroup: Workgroup, but that is not the name of my workgroup.
That probably is because my smb.conf on comp. A needs editing.
Here is:
Removed: unnecessary clutter
Last edited by ckosloff on Tue Mar 22, 2011 11:03 pm, edited 1 time in total.
ckosloff
Level 3
Level 3
 
Posts: 151
Joined: Tue Jul 21, 2009 8:54 pm

Re: Networking issue: LMDE refuses to create share in home

Postby altair4 on Fri Mar 18, 2011 7:03 am

Posted from computer A (Julia 64-bit main edition).
Success!
I could connect to LMDE and see all my home directory, not just debshare.

Great !!!
I created the share as root, however it does not show up in Nautilus under my profile as shared, just as a directory.
It does show up shared to root.

That answers the question posed by the original title of this topic. If you created a share of /home/ckosloff/Debshare as root then the share definition will be owned by root. If you subsequently tried to share the same directory as ckosloff you would get this exact error message:
'net usershare' returned error 255: net usershare add: failed to add share debshare. Error was Operation not permitted

That's the way it should work. If you look at the ownership / permissions of "debshare" at /var/lib/samba/usershares you will see that it is owned by root with permissions to write by root but read by everyone else. When you tried to create the share as yourself you attempted to overwrite the share definition that's owned by root.

If you want the workgroup on Machine A to match the workgroup on LMDE then edit the smb.conf on Machine A and change the workgroup:
# Change this to the workgroup/NT-domain name your Samba server will part of
workgroup = WORKGROUP

Then restart samba:
On Mint - non-Debian the command is:
Code: Select all
sudo service smbd restart
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 15
Level 15
 
Posts: 5817
Joined: Tue Feb 03, 2009 10:27 am

Re: Networking issue: LMDE refuses to create share in home

Postby ckosloff on Fri Mar 18, 2011 9:59 pm

This is the content of file Debshare in /var/lib/samba/usershares
#VERSION 2
path=/home/ckosloff/Debshare
comment=
usershare_acl=S-1-1-0:F
guest_ok=n

If I change it to guest_ok=y
will it work?
How can I make it accessible?
We are making good progress but I still have questions, maybe this thread is becoming too long.
I can start another one if necessary.
I understood all your explanations, everything is clear to me, thank you very much.
ckosloff
Level 3
Level 3
 
Posts: 151
Joined: Tue Jul 21, 2009 8:54 pm

Re: Networking issue: LMDE refuses to create share in home

Postby altair4 on Sat Mar 19, 2011 7:50 am

ckosloff wrote:This is the content of file Debshare in /var/lib/samba/usershares
#VERSION 2
path=/home/ckosloff/Debshare
comment=
usershare_acl=S-1-1-0:F
guest_ok=n

If I change it to guest_ok=y
will it work?
How can I make it accessible?
We are making good progress but I still have questions, maybe this thread is becoming too long.
I can start another one if necessary.
I understood all your explanations, everything is clear to me, thank you very much.

Based on your earlier post it already is accessible so you have me confused again.

If you mean accessible to everyone then yes that last line will have to change.

But don't edit /var/lib/samba/usershares/debshare directly because that will not work. It won't work because the Linux file permissions on /home/ckosloff/Debshare won't be set right for guest access.

Instead go back to Nautilus ( as root since root owns the share definition ) > Right Click /home/ckosloff/Debshare > Sharing Options > enable "Guest access" and then it will ask you if you want it to modify permissions.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 15
Level 15
 
Posts: 5817
Joined: Tue Feb 03, 2009 10:27 am

Re: Networking issue: LMDE refuses to create share in home

Postby ckosloff on Sat Mar 19, 2011 11:26 pm

Well, the whole home folder is accessible, and also Debshare, but as a folder, it does not show the share icon.
I did follow instructions, and, as root, enabled guest access.
Restarted computer and Debshare still does not show the little hand icon.
I feel like deleting this share altogether, there is nothing much in it, I just created it for testing.
I managed to create under my profile another share, called dinoshare, this one shows the icon and everything, so I guess that part of my inquiry is done.
I have other questions though, because the Debian computer cannot access the Main, and I still have to be able to connect to Windows shares, and the Windows computers should be able to see my Linux shares (is that possible?).
By the way, the samba daemon is running in Main too.
So, what do you think of opening another thread to handle these other questions, in order to keep the forum nice and tidy?
Thanks for all the help!
ckosloff
Level 3
Level 3
 
Posts: 151
Joined: Tue Jul 21, 2009 8:54 pm

Re: Networking issue: LMDE refuses to create share in home

Postby ckosloff on Sat Mar 19, 2011 11:56 pm

I posted a tad bit in haste.
The Debian machine is always accessible from Main, but only with the IP address.
I checked on the router, and there is no name for it, although terminal does show a name for this computer (lmde10).
Surprisingly, the main edition computer does have a name in the network (Julia-Pavilion).
I would like the LMDE to have a name too, how do I go about it?
ckosloff
Level 3
Level 3
 
Posts: 151
Joined: Tue Jul 21, 2009 8:54 pm

Re: Networking issue: LMDE refuses to create share in home

Postby altair4 on Sun Mar 20, 2011 9:08 am

Well, the whole home folder is accessible, and also Debshare, but as a folder, it does not show the share icon.
I did follow instructions, and, as root, enabled guest access.
Restarted computer and Debshare still does not show the little hand icon.

Don't base anything on the little share emblem in nautilus - it's an unreliable indicator if something is shared as it appears and disappears apparently based on temperatures and humidity levels. :wink: Besides even when it's working it will only display that emblem to the user that created it ( root ).
The Debian machine is always accessible from Main, but only with the IP address.
I checked on the router, and there is no name for it, although terminal does show a name for this computer (lmde10).
Surprisingly, the main edition computer does have a name in the network (Julia-Pavilion).
I would like the LMDE to have a name too, how do I go about it?

Your Debian machine does have a name. By default Samba will use the host name of the computer it's running on as the netbios name. When you ran smbtree on the Debian machine it listed your share with the correct netbios name:
\\LMDE10 lmde10 server
\\LMDE10\debshare
\\LMDE10\ckosloff Home Directories
\\LMDE10\Print_to_PDF Print to a PDF File
\\LMDE10\IPC$ IPC Service (lmde10 server)
\\LMDE10\print$ Printer Drivers

If the other computers can't see lmde10 then this isn't really a samba issue it's a networking issue. The first thing you can try is to reorder the way the Debian machine announces it's presence to the network:

Add a line to the [global] section of smb.conf:
Code: Select all
name resolve order = bcast host lmhosts wins

Save smb.conf and restart samba:
Code: Select all
sudo service samba restart

Wait a few minutes for the network to settle down and see if others can see your Debian machine.

BTW, can you post the make and model of your router. There's a way to have your router issue a static ip address to your machines using something called "DHCP Reservation" that can also be used to fix this networking problem.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 15
Level 15
 
Posts: 5817
Joined: Tue Feb 03, 2009 10:27 am

Re: Networking issue: LMDE refuses to create share in home

Postby ckosloff on Mon Mar 21, 2011 10:23 pm

Hi altair,
Thanks for continuing support.
Added lines to smb.conf, restarted samba, then restarted computer, then restarted whole network.
Same situation: router still does not see the name for 192.168.0.116.
Moreover, I get this error:
Could not display "smb://lmde10/ckosloff/"
Error: failed to mount Windows share
Please select another viewer and try again.
I can access via IP.
Regarding router: it is a D-Link DIR-635.
It can only assign one reservation and it is taken by the network printer.
Otherwise it would be a nightmare after each lease renewal.
It is strange that all devices connected to the router have a netbios name, except for lmde10.
BTW, I have a problem in main computer too, it cannot display its smbtree, but I reserve that one for the networking forum.
Just mentioning this for the implications it might have here, because I am using main to connect to lmde10.
ckosloff
Level 3
Level 3
 
Posts: 151
Joined: Tue Jul 21, 2009 8:54 pm

Re: Networking issue: LMDE refuses to create share in home

Postby altair4 on Tue Mar 22, 2011 7:03 am

ckosloff wrote:Regarding router: it is a D-Link DIR-635.
It can only assign one reservation and it is taken by the network printer.
Otherwise it would be a nightmare after each lease renewal.

I have a D-Link router myself ( not your model ) and if there is a limit I'm not aware of it ( I currently have 8 Reserved DHCP ip addresses ). The 635 even has a table where you can list all of them:
Screenshot.png
Screenshot.png (48.24 KiB) Viewed 6639 times

It's true that the lease will expire at a given interval but it will renew to the same reserved ip address. I've had the same ip address on one of my boxes for 4 years. While you're in there you might want to make sure your "Always broadcast" box is checked.
It is strange that all devices connected to the router have a netbios name, except for lmde10.

I've got a funny feeling your firewall is getting in the way assuming you enabled one on LMDE. You can check it by installing the following package:
Code: Select all
sudo apt-get install nmap

And running the following command:
Code: Select all
sudo nmap -sS -sU -T4 192.168.0.100

Changing 192.168.0.100 to the ip address of the LMDE box.
You need the following ports to be open for samba to work:
PORT STATE SERVICE
139/tcp open netbios-ssn
445/tcp open microsoft-ds
137/udp open|filtered netbios-ns
138/udp open|filtered netbios-dgm

BTW, I have a problem in main computer too, it cannot display its smbtree, but I reserve that one for the networking forum.

You mean that smbtree comes back blank or it lists everything on the network except it's own shares?
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 15
Level 15
 
Posts: 5817
Joined: Tue Feb 03, 2009 10:27 am

Linux Mint is funded by ads and donations.
 
Next

Return to Other networking topics

Who is online

Users browsing this forum: No registered users and 1 guest