Solved

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

Posted on 2015-01-07
11
73 Views
Last Modified: 2016-08-13
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
Comment
Question by:Letterpart
  • 6
  • 5
11 Comments
 
LVL 37

Expert Comment

by:Gerwin Jansen
ID: 40535289
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
 
LVL 1

Author Comment

by:Letterpart
ID: 40540287
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
 
LVL 37

Expert Comment

by:Gerwin Jansen
ID: 40565108
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
 
LVL 1

Author Comment

by:Letterpart
ID: 40598043
Hi,

sorry for the delay.

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

http://screencast.com/t/iv9roD75
0
 
LVL 37

Expert Comment

by:Gerwin Jansen
ID: 40599487
Can you post your smb.conf?
0
 
LVL 1

Author Comment

by:Letterpart
ID: 40633468
Hi,

sorry for delay. Here it is
smb.conf.txt
0
 
LVL 37

Accepted Solution

by:
Gerwin Jansen earned 500 total points
ID: 40634105
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
 
LVL 1

Author Comment

by:Letterpart
ID: 40658310
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
 
LVL 37

Expert Comment

by:Gerwin Jansen
ID: 40662298
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
 
LVL 1

Author Comment

by:Letterpart
ID: 40682295
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
 
LVL 37

Expert Comment

by:Gerwin Jansen
ID: 40682358
Thanks for  your feedback, if you have other questions or need further info, just let us know.
0

Join & Write a Comment

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Online collaboration is quickly becoming embedded in the workplace, and its benefits are tangible. See what the current landscape looks like and what the future holds for collaboration tools and the future of work.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now