Welcome to WebmasterWorld Guest from 62.210.77.51

Forum Moderators: bakedjake

Message Too Old, No Replies

Samba: Public File Sharing (no password )

Samba: Public Sharing Without Username/Password?

     
5:02 pm on Dec 19, 2002 (gmt 0)

Junior Member

10+ Year Member

joined:Aug 14, 2002
posts:153
votes: 0


Here's my setup, OpenBSD with a public Samba share accessible to Windows, Mac OS and other Unix machines.

My first question is, since I've setup this samba share to be public why does it keep prompting for a password when a password is not needed? How can I get ride of this prompt? BTW, this occurs on a Windows 2000/XP machines. Haven't needed to test it on the other OSs at present.

My second question is, how can I make this share allow people when they get into the /usr/files/storage/incoming/ sub-directory to upload files but not delete or modify them? If I have to allow for deleting to have uploading then that is fine. I just do not want to have to make everyone go to a entirely separate share just to upload files to the server.

Here's by configuration of the samba share below....

[storage]
comment = Storage (public files)
writable = no
path = /usr/files/storage
public = yes
only guest = yes
guest account = nobody
browsable = yes

6:27 pm on Dec 22, 2002 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Sept 21, 1999
posts:2141
votes: 0


I have W2K talking to Samba on a RedHat 7.1 distro without requesting a P/W. I think you need to add "guest ok=yes" to your share. From the Samba config docs:

guest ok
If this parameter is yes for a service, then no password is required to connect to the service. Privileges will be those of the guest account.

and:

guest only
If this parameter is yes for a service, then only guest connections to the service are permitted. This parameter will have no effect if "guest ok" is not set for the service.

As to your second question, a share is either writeable or not, and subdirs inherit this property. I think you can make the share writeable and chmod the individual subdirectories to control/limit access.

3:52 pm on Dec 23, 2002 (gmt 0)

Junior Member

10+ Year Member

joined:Aug 14, 2002
posts:153
votes: 0


Thanks for the reply!

guest ok
Mmmm.. okay but I thought "guest ok=yes" is a synonym of public. I tried adding "guest ok = yes" and nothing changed. I even kill the processes of nmbd/smbd and restarted them. Here's what I haven now.

[storage]
comment = Storage (public files)
writable = yes
path = /usr/files/storage
public = yes
guest ok = yes
guest only = yes
guest account = nobody
browsable = yes

guest only/only guest
I totally agree but since I have public this should not be a problem. Public or guest ok are synonyms. I have both to see if that helped but nothing has changed. It is still asking for username/password.

Incoming Directory
I would agree. But I tried that but no success. I originally had only a symbolic link to the sub-directory I wanted guest users to be able to upload to. So I figured that might be an issue so I moved the directory in, no difference. Here's what it looks like, maybe I'm out to lunch here but it still doesn't allow me to put files in the Incoming sub-directory.

drwxrwxr-x 3 adouglas wheel 512 Dec 23 09:06 files

Here's where the share in samba starts /usr/files/storage.
drwxr--r-x 7 adouglas wheel 512 Dec 23 09:07 storage

Contains of Storage
drwxr--r-x 7 adouglas wheel 512 Dec 23 09:07 .
drwxrwxr-x 3 adouglas wheel 512 Dec 23 09:06 ..
drwxr--r-x 2 adouglas wheel 512 Aug 7 11:32 AreaCodes DB
drwxr--r-x 16 adouglas wheel 3072 Oct 9 08:24 Documents
drwxrwxrwx 2 adouglas wheel 512 Dec 23 09:08 Incoming
drwxr--r-x 6 adouglas wheel 512 Sep 16 13:05 Software
drwxr--r-x 4 adouglas wheel 512 Aug 19 11:56 VenmarSelect

Do you have any more ideas on how to resolve my two issues?

5:42 pm on Dec 23, 2002 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Sept 21, 1999
posts:2141
votes: 0


My setup is just a handy peer to peer at home. W2K is the primary OS on both machines and I added Linux to the back up/test server machine to learn some *nix. It drove me nuts until I could get them talking to each other! I learned to Samba, but only a few steps I'm afraid! ;) My local network is heavily protected by firewalls too.

Here's my entire smb.conf (the names have been changed to protect the innocent... um... er... network):

[global]
workgroup = SOME_WORKGROUP
server string = Dave's Samba Server
netbios name = somename
hosts allow = XX.XXX.XXX.XXX XX.XXX.XXX.XXX
security = share
smb passwd file = /etc/samba/smbpasswd

[Dave]
guest ok = yes
guest only = yes
guest account = ftp
path = /home/dave/Dave's Shared Files
writeable = yes

[root]
guest ok = yes
guest only = yes
guest account = ftp
path = /Root's Shared Files
writeable = yes

In the Global section, "security = share" should open the door for you but it may not be acceptable in your environment. It's the only way I was able to establish a connection without a password.

Using chmod as I suggested works fine for me so I suspect that "guest account = nobody" is the culprit. The default in smb.conf is "guest account = ftp" and since I know nothing about setting up user accounts... It works for me!

Just a reminder (I suspect you already know but...), you MUST restart the Samba server after each change to smb.conf to force it to read and begin using the new file.

5:17 am on Dec 24, 2002 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Sept 21, 1999
posts:2141
votes: 0


I've given this some more thought, it was some time back when I set it up... As far a W2K is concerned, my systems are in a "Workgroup Setting," M$ terminology. Since both systems are secure within my home, I've disabled the requirement to login to the workgroup.

See "To require or disable a logon password in a workgroup setting" in the W2K help file for more info. The problem may not be with your share at all or there may be problems at both ends.

2:19 pm on Dec 24, 2002 (gmt 0)

Junior Member

10+ Year Member

joined:Aug 14, 2002
posts:153
votes: 0


Ok, my systems here are on a domain so that check box according to the help does not appear when you are connected to a network domain. Mmm.. I don't understand why this is such an issue. I would like to resolve it or at least understand why it's doing it if I can't stop it from prompting for a username and password.

I've also looked into the stuff you mentioned in the previous reply and I have gain some improvement but it still prompts for a username/password. I'm at a lose here. Maybe I should try posting some messages in the Unix mailing lists to see if there is bigger audience of Unix users or maybe I should say interesting in helping me out :).

Thanks for your help, I appreciated it. If you happen to think of anything else let me know!

6:47 pm on Dec 24, 2002 (gmt 0)

Senior Member

WebmasterWorld Senior Member littleman is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:June 17, 2000
posts:2924
votes: 0


Okay, silly question...
Why do people use Samba instead of using a local FTP server? Is it just a question of keeping the system backwards compatible with MS?
7:20 pm on Dec 24, 2002 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Sept 21, 1999
posts:2141
votes: 0


I used it 'cause I'm lazy! :) I'm used to the Network Neighborhood being so handy between my Windoze systems and wanted similar convenience with *nix.

But I think the real answer is that Samba can network so many OSs.

OpenBSD with a public Samba share accessible to Windows, Mac OS and other Unix machines
When correctly setup, it's pretty easy to use and fairly transparent to users.
7:26 pm on Dec 24, 2002 (gmt 0)

Junior Member

10+ Year Member

joined:Aug 14, 2002
posts:153
votes: 0


For one FTP is extremely insecure protocol. Plus FTP is not exactly user friendly. With Samba you can seaming blend in a server into an environment with Windows and a user wouldn't even know it. Mapping a drive letter to the service is all that is really required. Plus you do not have to setup Unix/Linux accounts on the server for a user to gain access. That would have to be done with FTP if you want to setup a user level access security. You can do simple security settings without an account at all in Samba and if you do want more security control you just setup an account in Samba not in the OS. Saves on resources.

I wouldn't recommend using FTP at all... maybe SFTP at the least.

Go check out Samba at [samba.org...]

5:43 pm on Dec 25, 2002 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Sept 21, 1999
posts:2141
votes: 0


While working on an unrelated project, I found a Samba doc I had printed while trying to get my machines talking, it may be useful to you. I found a version here [samba.org]. It's more recent than my copy but may not be the latest.
5:42 pm on Jan 6, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:Aug 14, 2002
posts:153
votes: 0


Thanks. I had a read over the documentation and it's not what I'm looking for. That is a discussion on how to set things up right with Samba using domain authentication. I'm using user authentication with a public share (no username/password required). Need to stop the dialog from asking for the username/password.

I found some other good docs on samba.org but didn't resolve my issue. They always seem to have information about people having the issue of asking for the username and password when your using domain authentication but not user authentication... odd.