[SOLVED] cannot share folder through samba

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

[SOLVED] cannot share folder through samba

Postby xpanta on Mon Jan 21, 2013 9:21 am

Hi,

I am trying to share a public folder and share my printer to my laptop (Windows XP Home. Name: notebook, workgroup: WORKGROUP)
Although I can see "mint-desktop" as network node on my windows laptop, whenever I try to open it I get a "cannot connect to \\Mint-desktop... etc" message.
I, also, cannot print.


Code: Select all
chris@mint-desktop ~ $ smbtree
Enter chris's password:
WORKGROUP
   \\NOTEBOOK             Laptop
      \\NOTEBOOK\SharedDocs        
      \\NOTEBOOK\IPC$              Remote IPC
   \\MYBOOKWORLD          My Book World Edition Network Storage
      \\MYBOOKWORLD\Public            Public Share
      \\MYBOOKWORLD\Download          Download Share
      \\MYBOOKWORLD\Backup            backup data
      \\MYBOOKWORLD\Rubini            Rubinis Data
      \\MYBOOKWORLD\LinuxHome         Linux Home Folder
      \\MYBOOKWORLD\Configuration     System Configuration
      \\MYBOOKWORLD\IPC$              IPC Service (My Book World Edition Network Storage)
   \\MINT-DESKTOP         mint-desktop server (Samba, LinuxMint)


Code: Select all
chris@mint-desktop ~ $ testparm -s
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 "[Public]"
WARNING: The security=share option is deprecated
Loaded services file OK.
Server role: ROLE_STANDALONE
[global]
   server string = %h server (Samba, LinuxMint)
   security = SHARE
   encrypt passwords = No
   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* .
   username map = /etc/samba/smbusers
   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
   hosts allow = 192.168.1.

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

[print$]
   comment = Printer Drivers
   path = /var/lib/samba/printers
   read only = No
   guest ok = Yes

[Public]
   comment = Public
   path = /home/chris/Public
   read only = No
   guest ok = Yes


Code: Select all
chris@mint-desktop ~ $ net usershare info --long
chris@mint-desktop ~ $


Any help will be appreciated.

Thanks
Last edited by xpanta on Tue Jan 22, 2013 4:10 pm, edited 2 times in total.
Linux Mint 14, Cinnamon. Intel E6800.4GB RAM. nVidia GT630.
xpanta
Level 1
Level 1
 
Posts: 23
Joined: Wed Nov 07, 2012 7:33 am

Linux Mint is funded by ads and donations.
 

Re: cannot share folder through samba

Postby altair4 on Mon Jan 21, 2013 9:37 am

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

Change this:
security = SHARE
encrypt passwords = No

TO this:
security = USER
encrypt passwords = Yes

Save the file and restart smbd:
Code: Select all
sudo service smbd restart

Unfortunately every time you restart smbd the network has a hissy fit so wait a few minutes and see if you can connect.

There is one more potential problem:
[Public]
comment = Public
path = /home/chris/Public
read only = No
guest ok = Yes

/home/chris/Public has permissions of 775 but your share allows guest write access so Linux itself will prevent a write by an anonymous guest. You have a couple of options:

[1] Change permissions on the shared folder to allow "others" to write to the folder:
Code: Select all
sudo chmod 777 /home/chris/Public

[2] Force the remote guest to appear to be "chris" for that share:
[Public]
comment = Public
path = /home/chris/Public
read only = No
force user = chris
guest ok = Yes

And then restart smbd again. In this case when the remote guest tries to access the share his identity will be converted to chris and everything he accesses or saves will be as chris.
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: 6054
Joined: Tue Feb 03, 2009 10:27 am

Re: cannot share folder through samba

Postby xpanta on Tue Jan 22, 2013 12:52 am

Hi,

Thank you very much for your answer.

However, I still cannot connect from my Windows XP Laptop. And it is not a problem with my Windows XP because I can connect to my network storage.

I did the modifications you suggested and here is the new output:

(net usershare info --long and smbtree give me nothing)

Code: Select all
chris@mint-desktop ~ $ testparm -s
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 "[Public]"
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* .
   username map = /etc/samba/smbusers
   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
   hosts allow = 192.168.1.

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

[print$]
   comment = Printer Drivers
   path = /var/lib/samba/printers
   force user = chris
   read only = No
   guest ok = Yes

[Public]
   comment = Public
   path = /home/chris/Public
   force user = chris
   read only = No
   guest ok = Yes
Linux Mint 14, Cinnamon. Intel E6800.4GB RAM. nVidia GT630.
xpanta
Level 1
Level 1
 
Posts: 23
Joined: Wed Nov 07, 2012 7:33 am

Re: cannot share folder through samba

Postby snison on Tue Jan 22, 2013 1:00 am

There has been more than one machine on Mint Nadia I've had to force the user, as described above.

Code: Select all
read only = No
force user = chris
guest ok = Yes


But when you say cannot connect, does that mean it pops up a username/password box, doesn't connect at all, etc? Have you restarted the XP box?
I generally don't use salutation, valedication, or please when answering your questions. I'm not a jerk; you have a question, I have a possible solution.
snison
Level 2
Level 2
 
Posts: 81
Joined: Wed Dec 26, 2012 12:42 am

Re: cannot share folder through samba

Postby altair4 on Tue Jan 22, 2013 8:00 am

Add a line under the workgroup line in smb.conf:
Code: Select all
name resolve order = bcast host lmhosts wins

Then restart samba:
Code: Select all
sudo service smbd restart

Code: Select all
sudo service nmbd restart

Wait 5 minutes and then run smbtree again.

If there is no output disable the firewall on Mint and try it again:
Code: Select all
sudo ufw disable
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: 6054
Joined: Tue Feb 03, 2009 10:27 am

Re: cannot share folder through samba

Postby xpanta on Tue Jan 22, 2013 3:35 pm

Thank you.

disabling the firewall did it!

But does that mean that I have no firewall, now? Can I configure firewall to accept incoming requests from the laptop?

I know it is another topic, but if you tell me it can be done, I will find a way (hopefully -- or start a new thread) :-)
Linux Mint 14, Cinnamon. Intel E6800.4GB RAM. nVidia GT630.
xpanta
Level 1
Level 1
 
Posts: 23
Joined: Wed Nov 07, 2012 7:33 am

Re: cannot share folder through samba

Postby altair4 on Tue Jan 22, 2013 4:02 pm

When samba installs it creates a file at /etc/ufw/applications.d which defines which ports need to be opened on an enabled firewall. So you should be able to enable your firewall again and run the following command to open the samba ports:
Code: Select all
sudo ufw allow Samba
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: 6054
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 3 guests