Samba and the new Debian Wheezy


9 posts
by stevep » Tue Jun 19, 2012 4:02 pm
Just downloaded the latest 2012-06-18-wheezy-beta and have been trying to set up Samba, using http://elinux.org/R-Pi_NAS#Connect_the_RPi_to_a_network as my guide. Trying to access my Mac from the Pi results in "operation not permitted". Trying to access the Pi from the Mac gives me "Connection failed - the server 'raspberrypi' may not exist or it is unavailable etc etc".

The Wiki instructions on setting up users
Code: Select all
sudo smbpasswd -a pi
and
Code: Select all
sudo useradd john -m -G users
sudo passwd john
don't work, so I've had to miss this bit out, which might be important....

Any ideas what I'm doing wrong?
Posts: 71
Joined: Sat Dec 24, 2011 10:12 am
by Zidbeans » Mon Jun 25, 2012 6:18 pm
smbpasswd seems to no longer exist
So instead, use:
Code: Select all
sudo pdbedit -a -u pi


where "pi" is the username in question.
Posts: 7
Joined: Mon Jun 25, 2012 6:17 pm
by stevep » Tue Jun 26, 2012 10:18 am
Apparently smbpasswd doesn't work unless you install samba-common-bin, according to a poster on another thread (Dante-something I think). Neither does pdbedit, at least it didn't for me. I have now installed samba-common-bin and have done the password bit of the process, but I still can't connect to the Pi from the Mac (using smb://192.168.1.6/steve) - "There was an error connecting to the server etc".
I've removed Samba and re-installed it with no effect (although I noticed that this didn't remove the smb.conf file and replace it with a new fresh one, as it still had all my edits in place).
Losing the will to live on this particular problem now - there must be some basic step(s) I'm not picking up from the tutorial on e-linux, or there is something specific to Wheezy that is throwing up a problem.
Posts: 71
Joined: Sat Dec 24, 2011 10:12 am
by the_lurker » Tue Jun 26, 2012 5:58 pm
Stupid question. I have the same problem and I entered
sudo /etc/init.d/samba restart
I get an error.
Did you get the same?
Posts: 11
Joined: Wed Feb 01, 2012 4:03 pm
by stevep » Tue Jun 26, 2012 10:15 pm
No, the restart works just as it should ie how it's described in the e-linux how-to guide.
Posts: 71
Joined: Sat Dec 24, 2011 10:12 am
by stevep » Wed Jun 27, 2012 9:17 am
Finally got Samba working. During the process I managed to trash my smb.conf file - it wasn't recreated on a subsequent apt-get remove and install, so I copied a minimal one from a random internet source, added a few lines that seemed appropriate and by some miracle it worked. All very well, but this is what I hate about Linux - I managed to get it working by not knowing what I'm doing, but trying to do it the right way by following instructions didn't work at all. I am now no further forward in terms of understanding. :x
Code: Select all
# Samba config file
# from RaspPi (127.0.0.1)
# Date: 2012/06/27 06:45:14

[global]
   workgroup = WORKGROUP
   domain logons = Yes
   os level = 65
   preferred master = Yes
   wins support = Yes
   idmap config * : backend = tdb
   ;smb passwd file = /etc/samba/passwd
[homes]
   read only = No
   browsable = No
   create mask = 0644
   directory mask = 0775
[netlogon]
   path = home/steve/Share
   guest ok = yes
[profiles]
   ;
   ;
   ;
[printers]
   comment = All Printers
   path = /var/spool/samba
   printable = Yes
   browseable = No

#
#Created by me in desperation on 26th June 2012
#
Posts: 71
Joined: Sat Dec 24, 2011 10:12 am
by AndrewS » Wed Jun 27, 2012 12:02 pm
stevep wrote:All very well, but this is what I hate about Linux - I managed to get it working by not knowing what I'm doing, but trying to do it the right way by following instructions didn't work at all. I am now no further forward in terms of understanding. :x

If you have the time, and you're still willing to learn, you could try comparing the working config file and the non-working config file, and try "fiddling" them backwards and forwards (and restarting samba) until you can work out why one version works and the other version doesn't work? And you'd learn a lot more about the smb.conf file in the process :)
User avatar
Posts: 2193
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
by lumi » Mon Jul 16, 2012 1:00 am
similar experience using wheezy

when googling the issue there were so many diff ways to setup the conf just for squeeze , it leaves me confused as which i should use. i know im trying wheezy but just the fact so many differences on squeeze was confusing.

i cant see the wood for the trees, its one thing i dislike about linux. Though im determined to get better. Anyways

sudo pdbedit -a -u pi

seemed to work for the pi user

but public folder sharing failed from following instructions

http://elinux.org/R-Pi_NAS#Connect_the_RPi_to_a_network

as dids simons last part from this link

viewtopic.php?t=8657&p=109921

his site seems down at mo so cant check the rest
Posts: 27
Joined: Sat Jul 14, 2012 12:19 am
by lumi » Mon Jul 16, 2012 3:21 am
doh i got it to work

http://elinux.org/R-Pi_NAS#Connect_the_RPi_to_a_network

this guide did work for me with the addition of, sudo pdbedit -a -u pi in place of sudo smbpasswd -a pi
in wheezy

now where it did not explain or i missed it was that when setting this part up
[public]
comment = Public Storage
path = /home/shares/public
valid users = @users
force group = users
create mask = 0660
directory mask = 0771
read only = no

(nb i had changed the path to a folder i had named eg /media/store/shares)

this resided on a sep paritition i had made, now in windows u share the folder out and if u dont rename the share it will be the name of the folder so in my case shares..
so im trying to map to this and this was my mistake.

the name of the share in this case in samba is public from the [public] part so i renamed that to shares hey presto i could then map to \\raspberrypi\shares n login with pi user, havent tried others yet.

[shares]
comment = Public Storage
path = /media/store/shares
valid users = @users
force group = users
create mask = 0660
directory mask = 0771
read only = no

if im not quite right im sure someone will correct me
Posts: 27
Joined: Sat Jul 14, 2012 12:19 am