Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 124
  • Last Modified:

Configure Samba to not require username/password to connect to shares

Hi,

I'm running Samba Samba version 3.6.6 on a Raspberry Pi (Debian Linux 7.6) and would like to set up my shares so I don't need a username/password to access them from mac/Windows on the Workgroup.

I spent hours last night searching for how to do this but just seem to muck up my config and make things worse.

Here is what I have in smb.conf

[global]
	log file = /var/log/samba/log.%m
	passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
	obey pam restrictions = yes
	map to guest = bad user
	encrypt passwords = true
	passwd program = /usr/bin/passwd %u
	passdb backend = tdbsam
	wins support = true
	dns proxy = no
	netbios name = NAS
	unix password sync = yes
	workgroup = WOODLANDS
	os level = 20
	security = share
	syslog = 0
	panic action = /usr/share/samba/panic-action %d
	usershare allow guests = yes
	max log size = 1000
	pam password change = yes

[MUSIC]
	path = /media/BACKUP 01/System Backup/Music
	writeable = yes

Open in new window


Thanks for your help.
0
Letterpart
Asked:
Letterpart
  • 6
  • 5
1 Solution
 
Gerwin Jansen, EE MVETopic Advisor Commented:
I would just use CIFS instead of SMB, install CIFS first:
sudo apt-get install cifs-utils

Open in new window

Then add an entry to /etc/fstab

//<your rasberry IP>/MUSIC "/media/BACKUP 01/System Backup/Music" cifs guest,uid=1000,gid=1000,iocharset=utf8 0 0

Open in new window

To get the correct uid (1000 in example above) use:

id username

Reboot your Pi and try accessing \\<your rasberry IP>\MUSIC
0
 
LetterpartAuthor Commented:
I'd like to stick with Samba (just now but I may end up switching after I've torn all of my hair out).
0
 
Gerwin Jansen, EE MVETopic Advisor Commented:
OK, here's a Samba config:

[global]
guest account = nobody

[shared]
 comment = \\%N\shared
 path = /path/samba/shared
 force user = nobody
 browsable = yes
 public = yes
 writable = yes
 guest ok = yes

Open in new window


smbpasswd -an nobody
(press enter twice, enter no password)

ls -l /path/samba

drwxrwxrwx 2 root users 4096 Jan 22 21:15 shared/

ls -l /path/samba/shared
total 8
-rwxr--r-- 1 nobody nogroup 18 Jan 22 21:26 file2.txt*
-rwxr--r-- 1 nobody nogroup 11 Jan 22 21:11 file.txt*
0
 
LetterpartAuthor Commented:
Hi,

sorry for the delay.

I have run through what you posted and I now get this error:

http://screencast.com/t/iv9roD75
0
 
Gerwin Jansen, EE MVETopic Advisor Commented:
Can you post your smb.conf?
0
 
LetterpartAuthor Commented:
Hi,

sorry for delay. Here it is
smb.conf.txt
0
 
Gerwin Jansen, EE MVETopic Advisor Commented:
You have "security = share" in your global section, can you change that to "security = user" and try again?

Note that if I map both anonymous and with credentials that with Windows machines you need to map one using the server name and the other using the ip address.
0
 
LetterpartAuthor Commented:
Hi,

I've changed the security to user and can now log in with a username and password.

Can you run through how to make this anonymous access as I didn't understand your previous reply.

Thanks
0
 
Gerwin Jansen, EE MVETopic Advisor Commented:
If you're connecting from a Windows machine, you can connect anonymously to the ip address of the samba server and using username and password to the machine name of the samba server, so:

\\192.168.1.1\public (anonymously)
\\raspberrypi\home_folder (connect with username)

rasberrypi would be the hostname and 192.168.1.1 the ip address of it
0
 
LetterpartAuthor Commented:
I'm at the stage now where I still have to login with a user/pass to the share but I suppose I can live with that. I will install a media server so I can stream the contents out to other devices rather than having to rely on network shares.

I'm going to close this question now. It isn't resolved but through no fault of yours so will award you the points and thank you for your help.
0
 
Gerwin Jansen, EE MVETopic Advisor Commented:
Thanks for  your feedback, if you have other questions or need further info, just let us know.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

  • 6
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now