Solved

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

Posted on 2015-01-07
11
76 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
Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Running VB/Batch script through Group policy 30 80
Remove a folder in Linux 9 92
nagios remote hosts 9 46
forward schedule of change and individual change comms 3 20
We recently endured a series of broadcast storms that caused our ISP to shut us down for brief periods of time. After going through a multitude of tests, we determined that the issue was related to Intel NIC drivers on some new HP desktop computers …
Trying to figure out group policy inheritance and which settings apply where can be a chore.  Here's a very simple summary I've written which might help.  Keep in mind, this is just a high-level conceptual overview where I try to avoid getting bogge…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

863 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

21 Experts available now in Live!

Get 1:1 Help Now