Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm running a little RaspberryPi machine that I wanted to turn into a low power network share that is completely unprotected on my home network, the aim is for it to be a universal network dump and media share.

I have got USB drive mounted and read-writable from linux, the share is visible from my Windows8(64Bit) desktop without username or password, but nothing I have on the network including my W7(64Bit) can get read/write access to the share.

pi@SambaPi /var/log/samba $ uname -a
Linux SambaPi 3.6.11+ #474 PREEMPT Thu Jun 13 17:14:42 BST 2013 armv6l GNU/Linux

fstab:

proc            /proc           proc    defaults          0       0
/dev/mmcblk0p1  /boot           vfat    defaults          0       2
/dev/mmcblk0p2  /               ext4    defaults,noatime  0       1
/dev/sda1  /media/USBDRIVE  ntfs-3g rw,defaults,acl       0      0

cat /etc/samba/smb.conf | egrep -v '^#|^;|^$' (Samba config without blanks, comments and those odd semi-colons (What are those lines?) removed)

[global]
   workgroup = WORKGROUP
   realm = raspberrypi
   netbios name = raspberrypi
   server string = %h server
   dns proxy = no
   name resolve order = lmhosts host wins bcast
   log file = /var/log/samba/log.%m
   max log size = 1000
   syslog = 10
   panic action = /usr/share/samba/panic-action %d
   security = SHARE
   encrypt passwords = true
   passdb backend = tdbsam
   obey pam restrictions = yes
   unix password sync = yes
   passwd program = /usr/bin/passwd %u
   passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
   pam password change = yes
   map to guest = bad user
   socket options = TCP_NODELAY
   usershare allow guests = yes
[homes]
   comment = Home Directories
   browseable = yes
[USB]
   path = /media/USBDRIVE
   comment = Media Share
   writeable = yes
   browseable = yes
   guest ok = yes
   public = yes
   force user = root
   read only = no
   read only = yes
   create mask = 0775
   directory mask = 0775

getfacl /media/USBDRIVE

# file: USBDRIVE/
# owner: root
# group: root
user::rwx
group::rwx
other::rwx
default:user::rwx
default:group::r-x
default:other::r-x

getfacl /media/USBDRIVE/testFileMadeAtCommantLine.txt

# file: testFileMadeAtCommantLine.txt
# owner: root
# group: root
user::rwx
group::rwx
other::rwx

I have been through my system logs and I have not seen anything that corresponds with the permissions messages I get when I try to add or delete a file to the share.

share|improve this question

migrated from serverfault.com Aug 2 '13 at 4:50

This question came from our site for professional system and network administrators.

add comment

2 Answers 2

up vote 1 down vote accepted

The force user setting doesn't mean you don't have to supply a password. From smb.conf:

This user name only gets used once a connection is established. Thus clients still need to connect as a valid user and supply a valid password. Once connected, all file operations will be performed as the "forced user", no matter what username the client connected as. This can be very useful.

Specify guest account value and give this user rwx permissions.

Also you have read only = yes and read only = no specified on the same share? Fix that.

You can use testparm command to check smb.conf for errors and print out bare samba configuration.

share|improve this answer
add comment

Janis. Your answer helped me out heaps. And it works just fine. I removed what you recommended, added what you recommneded and changed permissions and ownership to a "guest-like" user. My config now looks like this:

Pi had a usernamed games. chown'd all the files to that user and gave Games all permissions. And changed the config as you recommended.

Now it works great and my config is this:

[global]
   workgroup = WORKGROUP
   realm = raspberrypi
   netbios name = raspberrypi
   server string = %h server
   dns proxy = no
   name resolve order = lmhosts host wins bcast
   log file = /var/log/samba/log.%m
   max log size = 1000
   syslog = 10
   panic action = /usr/share/samba/panic-action %d
   security = SHARE
   encrypt passwords = true
   passdb backend = tdbsam
   obey pam restrictions = yes
   unix password sync = yes
   passwd program = /usr/bin/passwd %u
   passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
   pam password change = yes
   map to guest = bad user
   socket options = TCP_NODELAY
   usershare allow guests = yes
[homes]
   comment = Home Directories
   browseable = yes
[USB]
   path = /media/USBDRIVE
   comment = Media Share
   writeable = yes
   browseable = yes
   guest ok = yes
   guest account = games
   public = yes
   read only = no
   create mask = 0775
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.