PDA

View Full Version : Samba requiring a password and I'm tired



JBruyet
14th August 2008, 02:27 AM
Hey all,

I created a Samba share on my Fedora 9 server. I can see the share from an XP computer but I'm getting one of two error messages depending on my smb.conf file--Access Denied or a request for a password.

I originally set up the Samba share from System > Administration > Samba. Directory is /share. Share name is Share. Permissions are Read/Write and Visibility is Visible. Under Edit Samba Share Directory is /share and Share name is Share. Down below Writable and Visible both have check marks in them. Under Access I've put a check mark in Allow access to everyone. I've even tried putting a check mark in Only allow access to specific users, but I'm unable to get a user name to stick when I check that option. Every time I make a change I restart both the nmb and smb services. Here's a copy of my smb.conf file at this time:

# Global Parameters
[global]
workgroup = WorkgroupName
security = user

[Share]
path = /share
writeable = yes
guest ok = yes
browseable = yes

This smb.conf file gives me the password request when I try to access it from Windows. I've tried no security, domain security, user security and I have yet to gain access to this share from the Windows side of life. I've been on the Samba site, I've meandered through this forum, I've even started talking to the little elephant in a basket on my desk and nothing has helped. I did find one page somewhere that said to enter the following command as a test:

smbclient -L ServerName

THEN, it said that if I get a request for a password smb.conf is incorrectly configured. Yeah, well I kind of figured that part out but I'm clueless as to how to fix it.

My goal, at this time, is to just get a Linux share accessible by a Windows XP computer. Please help me. The elephant is starting to smirk at me and I'm not sure how much more of that I can take.

Thanks for looking through this post,

Joe B

forkbomb
14th August 2008, 04:29 AM
Did you create samba users on the Linux box?

I believe the syntax would be
smbpasswd -add <username>
At that point I believe it will prompt you for a password. Running the command without the -add switch can be used to change the samba password of an existing user.

Note that samba users are distinct from the local accounts on the box. You don't need to have a Linux user named "bob" to run smbpasswd -add bob that you can use to access the share from other machines.

w5set
14th August 2008, 06:29 AM
And here's the "dirt easy" approach :)
Lots of good info on setting up and accessing samba.
http://www.redhatmagazine.com/2007/06/26/how-to-build-a-dirt-easy-home-nas-server-using-samba/

JBruyet
14th August 2008, 07:20 PM
tjvanwyk, I used smbpasswd to create a user for Samba but I was never prompted for a password. Even so I tried to access the share from a Windows XP machine but no joy.

w5set, I'll take a look at your link after I get back from running some errands.

Thanks,

Joe B

JBruyet
14th August 2008, 10:33 PM
w5set, I tried using the "dirt easy" instructions and I'm getting one step further but I'm still getting the following error message on my Windows computer when I try to connect:

\\192.168.2.36\share is not accessible. You might not have permission to use this network resource. Contact the administrator of the server to find out if you have access permissions.
The network path was not found.

I've actually gone through the steps a couple of times, including the creation and password assignment for the user in step 1. I can get the share to appear in Explorer in Windows; I just can open it. Testparm gives me the "Loaded services file OK" message so that's right. Any other ideas on why this won't work for me?????

Thanks,

Joe B

JBruyet
16th August 2008, 06:54 PM
Ok, now I'm able to see my Samba share folder from my XP machine but I'm not able to get into it. I've chown'ed and chmod'ed it so many times I'm wearing the letters off of my keyboard. I found my old "Teach Yourself Samba in 24 Hours" book but even when using their basic example I'm not able to access the folder. I must have overlooked a small but essential step somewhere but I have no idea what it could have been. Would someone please give me a very basic smb.conf file and the steps to "guarantee" that it'll work? I've even tried to yum my Samba install but I get the following error:

Could not find update match for Samba
No Packages marked for Update

AND, on top of all of that, now when I try to restart the smb service I get a red "Failed" on the Shutting down SMB services. I can start the service just fine; it just won't shut down. The nmb service restarts just fine. Sheesh. It's almost enough to make me think about getting a Mac.

Thanks for listening,

Joe B

JBruyet
26th August 2008, 12:20 AM
Nobody's home in the Samba forum so I'm back here again.

I created another share thinking that maybe I did something wrong and totally screwed up the first one but I'm still having the same issue -- I can see the Samba share from Windows but I get an Access Denied error when I try to open the share from Windows. I've looked around and I don't see much about setting Rights and Permissions on Samba shares. Is there something additional that people think is so basic about creating a Samba share that they don't think about sharing that basic item with people having problems??? Is there something I can do to totally remove all restrictions from this share? Doing so wouldn't be much of a security risk at this time since there's nothing in the share and it's on a computer that can be recreated without heartburn.

Thanks in advance for the info,

Joe B

glennzo
26th August 2008, 12:22 AM
security = share instead of security = user should make a difference. Some would argue that this is insecure..

JBruyet
26th August 2008, 01:22 AM
glennzo,

I changed to security = share but I'm still getting Access Denied from Windows. Any other ideas???

Thanks,

Joe B

glennzo
26th August 2008, 01:33 AM
Yes. Lets say the name of the user on the Windows box is joe. On the Fedora box, open a terminal. As root or using sudo type smbpasswd -a joe. Restart smb and nmb

/sbin/service smb restart
/sbin/service nmb restart

It's been a long day. My brain is fried. I think I might have this backwards but at least it won't break anything.

One more thing. Any time you make a change to smb.conf you need to restart smb and nmb.

JBruyet
26th August 2008, 01:51 AM
glennzo:

smbpasswd -a jobee
password
retype password
restart of smb and nmb (<-- does the order matter?)
I tried to access the share and no joy

In fact, I tried it on my original share and the share I created this afternoon and neither one worked. Luckily I had lunch at 3:00 this afternoon or I'd be getting cranky. Question--where does the Rights and Permissions side of things come into play? Do I need to assign any kind of Anonymous rights to the shares???

Thanks,

Joe B

forkbomb
26th August 2008, 02:09 AM
glennzo:

smbpasswd -a jobee
password
retype password
restart of smb and nmb (<-- does the order matter?)
I tried to access the share and no joy

In fact, I tried it on my original share and the share I created this afternoon and neither one worked. Luckily I had lunch at 3:00 this afternoon or I'd be getting cranky. Question--where does the Rights and Permissions side of things come into play? Do I need to assign any kind of Anonymous rights to the shares???

Thanks,

Joe B
Hi Joe,

As far as I know you should only have to restart smb to get the config to re-initialize.

I had to struggle through exactly this problem today for a project (I think it's the exact same problem) of trying to get a non-passworded Samba share out there...

Unless I'm misunderstanding what you're looking for. This should get you a share named share on the directory /share that doesn't require client passwords or usernames... I think (I printed off several configs and I think the one I have in front of me worked)...

I made sure I did


# chmod 1777 /share -R

and then forced a Samba mask on the share (see below).

Here's the smb.conf I came up with (some of it may be uneccessary or redundant) minus the print shares I had to set up:



[global]
workgroup = WORKGROUP
netbios name = SAMBA
server string = Samba Server %v
max log size = 1000
log file = /var/log/samba/log.%m
;these are supposed to help with performance
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
preferred master = No
local master = No
dns proxy = No
force create mode = 777
security = share

[share]
path = /share
read only = No
browseable = Yes
writeable = Yes
guest okay = Yes
guest only = yes
public = yes


The bolded parts are relevant. The force create mode 777 is to make sure all users can write to the share fine. EDIT: But I believe local perms take precedence over samba perms (can somebody confirm?) so chmod as well to make sure.

ogetbilo
26th August 2008, 06:46 AM
Did you try disabling selinux? Sometimes selinux does not behave well. How about iptables?

scottro
26th August 2008, 11:44 AM
I have a very very basic Fedora/samba troubleshooting guide at http://home.nyc.rr.com/computertaijutsu/rhsamba.html

Note especially the link to the troubleshooting howto (requires a pdf reader). I think that it's always, once I've eliminated the basics covered on my page, enabled me to get it working.