Samba Public Shares


22 posts
by Kris » Sun Jun 17, 2012 8:39 pm
Hi,

I've been trying for hours to get Samba to do what I want, and have finally given up and need help :)

I'm new to linux but i'm getting there, other than issues with Samba..

I'm following this guide: http://elinux.org/R-Pi_NAS#Configure_a_ ... on_the_RPi

My Windows 7 PC is seeing the Pi without problems and I can browse my home directory, however the public folder cannot be accessed. I get a permission error.

my smb.conf extract is below.

[public]
comment = Public Storage
path = /mnt/sda4/Downloads
valid users = @users
force group = users
create mask = 0660
directory mask = 0771
read only = no

the path is to a USB hard drive that is mounted and accessible from within X.
The folder is owned by user = pi group = pi.

Any Ideas?

Thanks

Kris
Posts: 3
Joined: Sat Jun 16, 2012 7:27 pm
by simonthepiman » Wed Jun 20, 2012 7:52 pm
Hi Kris

I have samba running but only with a public share - my settings are
[usb]<br>
comment = USB Share<br>
path = /mnt/disk1<br>
writeable = Yes<br>
only guest = Yes<br>
create mask = 0777<br>
directory mask = 0777<br>
browseable = Yes<br>
public = yes<br>
I have also written a simple guide to setup a pi with samba i dont know if it helps
http://www.simonthepiman.com/how_to_setup_windows_file_server.php :geek:
Simon

http://www.simonthepiman.com (Beginners guides)
User avatar
Posts: 43
Joined: Mon Jun 04, 2012 11:42 am
Location: Battle - Sussex
by victagayun » Thu Jun 21, 2012 8:01 am
Hello simon,
In the filemanager, all my usb connected drives can be seen at /media, so i set the path to this. After saving and restart of samba, i can see the drive in the network (im using win7). But i cannot access the the drive themselves.
Say i make
[usb_drives]
Path = /media

All the drives are shown after the folder usb_drive but cannot access the individual drives. I hope u can help.
Posts: 84
Joined: Sun Apr 15, 2012 4:01 pm
by simonthepiman » Thu Jun 21, 2012 1:39 pm
Hi Victa
Have you followed my guide?, take a look at the fdisk -l command and see what you have there as its possible that the drive is not mounted correctly.
I am pretty sure it will also need to be a FAT/NTFS formatted drive for windows to read
I must admit i havnt used the gui yet as my Pi is remote but will take a look at redirecting to my PC so i can see.
Simon

http://www.simonthepiman.com (Beginners guides)
User avatar
Posts: 43
Joined: Mon Jun 04, 2012 11:42 am
Location: Battle - Sussex
by victagayun » Thu Jun 21, 2012 3:28 pm
hello simon it is showing /dev/sda using fdisk -l. From the gui in filemanager it is /media/1gig (testing one usbdrive).
i havent tried your tutorial because it is very long and very hard to understand at this moment. instead i am following this guide which is quite easier. i have done this in vmware (win7 host) using debian as guest. i connect the usb (host) to the guest and have shared it flawlessly.
here is the link:
http://www.linuxquestions.org/questions ... ms-946890/
another problem is that i cannot add using smdpasswd, any ideas?
Posts: 84
Joined: Sun Apr 15, 2012 4:01 pm
by simonthepiman » Thu Jun 21, 2012 3:54 pm
Hi Victa

It may be a typo in your post but the command is
sudo smbpasswd -a username
however by default the username should be a valid unix user
Simon

http://www.simonthepiman.com (Beginners guides)
User avatar
Posts: 43
Joined: Mon Jun 04, 2012 11:42 am
Location: Battle - Sussex
by victagayun » Thu Jun 21, 2012 4:09 pm
hello simon,
i copied from ssh

pi@raspberrypi ~ $
pi@raspberrypi ~ $
pi@raspberrypi ~ $
pi@raspberrypi ~ $ smbpasswd -a pi
-bash: smbpasswd: command not found
pi@raspberrypi ~ $
Posts: 84
Joined: Sun Apr 15, 2012 4:01 pm
by simonthepiman » Thu Jun 21, 2012 4:19 pm
Hi can you try
/usr/bin/smbpasswd
Simon

http://www.simonthepiman.com (Beginners guides)
User avatar
Posts: 43
Joined: Mon Jun 04, 2012 11:42 am
Location: Battle - Sussex
by simonthepiman » Thu Jun 21, 2012 4:20 pm
sorry missed a bit
sudo /usr/bin/smbpasswd
Simon

http://www.simonthepiman.com (Beginners guides)
User avatar
Posts: 43
Joined: Mon Jun 04, 2012 11:42 am
Location: Battle - Sussex
by victagayun » Thu Jun 21, 2012 4:37 pm
maybe something wrong with me...

pi@raspberrypi ~ $ sudo /usr/bin/smbpasswd -a pi
sudo: /usr/bin/smbpasswd: command not found
pi@raspberrypi ~ $ sudo smbpasswd -a pi
sudo: smbpasswd: command not found
pi@raspberrypi ~ $ sudo /usr/bin/smbpasswd -a pi
sudo: /usr/bin/smbpasswd: command not found
pi@raspberrypi ~ $
Posts: 84
Joined: Sun Apr 15, 2012 4:01 pm
by AndrewS » Thu Jun 21, 2012 5:55 pm
simonthepiman wrote:I am pretty sure it will also need to be a FAT/NTFS formatted drive for windows to read

If the drive is connected to the Raspi, it can be in any filesystem that Linux can read (including ext4, etc.). The only "filesystem" that Windows will see is CIFS i.e. Samba :)
User avatar
Posts: 3489
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
by simonthepiman » Thu Jun 21, 2012 6:34 pm
Andrew
Many thanks for your input
Simon

http://www.simonthepiman.com (Beginners guides)
User avatar
Posts: 43
Joined: Mon Jun 04, 2012 11:42 am
Location: Battle - Sussex
by Kris » Fri Jun 22, 2012 6:06 pm
simonthepiman wrote:Hi Kris

I have samba running but only with a public share - my settings are
[usb]<br>
comment = USB Share<br>
path = /mnt/disk1<br>
writeable = Yes<br>
only guest = Yes<br>
create mask = 0777<br>
directory mask = 0777<br>
browseable = Yes<br>
public = yes<br>
I have also written a simple guide to setup a pi with samba i dont know if it helps
http://www.simonthepiman.com/how_to_setup_windows_file_server.php :geek:


Hi Simon,

After posting my initial question I continued tinkering and finally gave up and took the easy option.

As the home share is working fine and the issue is with the public share, I changed /etc/fstab to mount the USB hard drive within my /home directory rather than within /mnt

This is working fine now, i just had to update transmission-daemon and minidlna to the new folder.

My RasPi is now a fully functional torrent downloader and DLNA streaming device :)

I almost feel the need for a 2nd Pi as this is now fully utilised, I don't want to go tinkering with it and wreck it.
Posts: 3
Joined: Sat Jun 16, 2012 7:27 pm
by victagayun » Fri Jun 22, 2012 8:11 pm
simonthepiman wrote:sorry missed a bit
sudo /usr/bin/smbpasswd

hello simon,
i found it in

pi@raspberrypi ~ $ find / -name smbpasswd
find: `/run/udisks': Permission denied
/usr/share/bash-completion/completions/smbpasswd

but still cannot execute
pi@raspberrypi ~ $ sudo /usr/share/bash-completion/completions/smbpasswd -a pi
sudo: /usr/share/bash-completion/completions/smbpasswd: command not found
pi@raspberrypi ~ $
Posts: 84
Joined: Sun Apr 15, 2012 4:01 pm
by simonthepiman » Fri Jun 22, 2012 8:58 pm
Hi

I would be tempted to install locate
sudo apt-get install locate
it allows quick finding of files.

You should have smbpasswd in /usr/bin/smbpasswd
if you havnt, then i dont think you have installed samba correctly, I would try
sudo apt-get install samba
again and check for errors
Simon

http://www.simonthepiman.com (Beginners guides)
User avatar
Posts: 43
Joined: Mon Jun 04, 2012 11:42 am
Location: Battle - Sussex
by dante6913 » Sat Jun 23, 2012 10:00 pm
sudo apt-get install samba-common-bin

then you can do

sudo smbpasswd -a pi
Posts: 15
Joined: Sat May 19, 2012 2:45 pm
by stevep » Sun Jun 24, 2012 7:10 am
dante6913 wrote:sudo apt-get install samba-common-bin

then you can do

sudo smbpasswd -a pi

Thanks for this - a really vital bit of info I'd have thought.
Posts: 71
Joined: Sat Dec 24, 2011 10:12 am
by simonthepiman » Wed Jun 27, 2012 8:51 am
Hi Guys
If you are using the default Rapberry Pi Debian Squeeze image then
i A samba-common - common files used by both the Samba server
i A samba-common-bin - common files used by both the Samba server
are both installed by default, but not the samba server
Simon

http://www.simonthepiman.com (Beginners guides)
User avatar
Posts: 43
Joined: Mon Jun 04, 2012 11:42 am
Location: Battle - Sussex
by craigy72 » Sun Nov 11, 2012 3:39 pm
to make it easier, just change the security = user to security = share in the config file.
Posts: 5
Joined: Mon Jul 09, 2012 12:17 pm
by RichardNixon » Wed Mar 13, 2013 4:18 am
SimonthePiman. Thank you for your great tutorial. I was able to set up the samba config file and successfully ran it through the parameter test. I also added pi as a samba user. Unfortunately, I could not log in from either a windows 7 or mac book air. on the windows machine I receive an error "access is denied" , If I purposely mistype the password I get "logon failure unknown user name or bad password"

Here is part of the log file from the Windows 7 machine:
Can't become connected user!
[2013/03/12 19:08:39.216681, 0] smbd/service.c:995(make_connection_snum)
Can't become connected user!
[2013/03/12 19:10:33.536818, 0] smbd/service.c:995(make_connection_snum)
Can't become connected user!
[2013/03/12 19:13:34.208685, 0] smbd/service.c:995(make_connection_snum)
Can't become connected user!
[2013/03/12 19:14:44.282029, 0] smbd/service.c:995(make_connection_snum)
Can't become connected user!
[2013/03/12 19:22:43.881219, 0] smbd/service.c:995(make_connection_snum)
Can't become connected user!
[2013/03/12 19:24:16.882975, 0] smbd/service.c:995(make_connection_snum)
Can't become connected user!
[2013/03/12 19:27:15.048756, 0] smbd/service.c:995(make_connection_snum)
Can't become connected user!
[2013/03/12 19:27:31.683805, 0] smbd/service.c:995(make_connection_snum)
Can't become connected user!
[2013/03/12 19:36:02.990185, 0] smbd/service.c:995(make_connection_snum)
Can't become connected user!
[2013/03/12 19:36:09.848393, 0] smbd/service.c:995(make_connection_snum)
Can't become connected user!
[2013/03/12 19:36:09.852100, 0] smbd/service.c:995(make_connection_snum)
Can't become connected user!
[2013/03/12 19:36:19.165768, 0] smbd/service.c:995(make_connection_snum)
Can't become connected user!
[2013/03/12 19:37:11.667974, 0] smbd/service.c:995(make_connection_snum)
Can't become connected user!
[2013/03/12 19:56:47.595914, 0] smbd/service.c:995(make_connection_snum)
Can't become connected user!
[2013/03/12 19:57:10.368750, 0] smbd/service.c:995(make_connection_snum)
Can't become connected user!
[2013/03/12 19:57:36.344611, 0] smbd/service.c:995(make_connection_snum)
Can't become connected user!
[2013/03/12 19:59:12.684480, 0] smbd/service.c:995(make_connection_snum)
Can't become connected user!
[2013/03/12 19:59:36.042699, 0] smbd/service.c:995(make_connection_snum)
Can't become connected user!
[2013/03/12 20:00:03.566372, 0] smbd/service.c:995(make_connection_snum)
Can't become connected user!
[2013/03/12 20:04:24.351419, 0] smbd/service.c:995(make_connection_snum)
Can't become connected user!
[2013/03/12 20:05:17.805796, 0] smbd/service.c:995(make_connection_snum)
Can't become connected user!
[2013/03/12 20:05:37.699461, 0] smbd/service.c:995(make_connection_snum)
Can't become connected user!
[2013/03/12 20:06:04.614872, 0] smbd/service.c:995(make_connection_snum)
Can't become connected user!
[2013/03/12 20:08:31.419019, 0] smbd/service.c:995(make_connection_snum)
Can't become connected user!
[2013/03/12 20:09:33.046872, 0] smbd/service.c:995(make_connection_snum)
Can't become connected user!
[2013/03/12 20:46:28.342442, 0] smbd/service.c:995(make_connection_snum)
Can't become connected user!
[2013/03/12 20:54:52.121894, 0] smbd/service.c:995(make_connection_snum)
Can't become connected user!


Log file from my Macbook Air
3/03/12 17:51:53.321298, 0] smbd/service.c:995(make_connection_snum)
Can't become connected user!
[2013/03/12 17:51:53.332396, 0] smbd/service.c:995(make_connection_snum)
Can't become connected user!
[2013/03/12 17:51:53.340543, 0] smbd/service.c:995(make_connection_snum)
Can't become connected user!
[2013/03/12 17:51:53.352361, 0] smbd/service.c:995(make_connection_snum)
Can't become connected user!
[2013/03/12 17:51:53.361282, 0] smbd/service.c:995(make_connection_snum)
Can't become connected user!
[2013/03/12 17:51:53.371466, 0] smbd/service.c:995(make_connection_snum)
Can't become connected user!
[2013/03/12 17:51:53.390409, 0] smbd/service.c:995(make_connection_snum)
Can't become connected user!
[2013/03/12 17:51:53.604370, 0] smbd/service.c:995(make_connection_snum)
Can't become connected user!


portions of the smb.conf file

## Browsing/Identification ###

# Change this to the workgroup/NT-domain name your Samba server will part of
workgroup = workgroupname

# server string is the equivalent of the NT Description field
server string = %h server

# Windows Internet Name Serving Support Section:
# WINS Support - Tells the NMBD component of Samba to enable its WINS Server

[usb]
comment = USB Share RP1
path = /mnt/disk1
writeable = Yes
only guest = Yes
create mask = 0777
directory mask = 0777
browseable = Yes
public = Yes




Any suggestions
Posts: 1
Joined: Wed Mar 13, 2013 4:01 am
by ally_uk » Sun Mar 17, 2013 12:00 pm
When you say the partition has to be formatted as NTFS in order for Windows to see it this does not make any sense. I have set up Samba shares in the past by just have a basic partiton layout

/boot
/
/home
/media
/tmp

The media share was setup as ext4 and once Samba was configured Windows Could see this share.

http://www.howtoforge.com/debian-squeez ... am-backend

Is a great SAMBA tutorial which also shows you how to add tdbsam ass security for your shares of all the tutorials I read this was the best :)
Posts: 10
Joined: Wed Jan 02, 2013 2:04 pm
by catkinso » Mon Apr 08, 2013 9:33 pm
short answer is that samba is EXTREMELY poorly implemented in this version of the OS. After fixing 2 other issues including samba think there was no space on the drive I have given up.

POS.
Posts: 8
Joined: Mon Apr 08, 2013 9:31 pm