On Wed December 10 2008 03:16 pm, dbsoundman wrote:
>
> Here is the smb.conf output:
>
> Code:
> --------------------
> dan@linux-8amt:~> sudo cat /etc/samba/smb.conf
> # smb.conf is the main Samba configuration file. You find a full commented
> # version at /usr/share/doc/packages/samba/examples/smb.conf.SUSE if the
> # samba-doc package is installed.
> # Date: 2008-11-21
> [global]
> workgroup = BLACKDIAMOND
> printing = cups
> printcap name = cups
> printcap cache time = 750
> cups options = raw
> map to guest = Bad User
> include = /etc/samba/dhcp.conf
> logon path = \%L\profiles.msprofile
> logon home = \%L%U.9xprofile
> logon drive = P:
> usershare allow guests = Yes
> add machine script = /usr/sbin/useradd -c Machine -d /var/lib/nobody -s
> /bin/false %m$ domain logons = Yes
> domain master = Yes
> local master = Yes
> os level = 65
> passdb backend = smbpasswd
> preferred master = Yes
> security = user
> wins support = Yes
> usershare max shares = 100
>
> [homes]
> comment = Home Directories
> valid users = %S, %D%w%S
> browseable = No
> read only = No
> inherit acls = Yes
>
> [profiles]
> comment = Network Profiles Service
> path = %H/
> read only = yes
> store dos attributes = Yes
> create mask = 0600
> directory mask = 0700
>
> [users]
> comment = All users
> path = /home/
> read only = No
> inherit acls = Yes
> veto files = /aquota.user/groups/shares/
> guest ok = Yes
>
> [groups]
> comment = All groups
> path = /home/groups/
> read only = yes
> inherit acls = Yes
>
> [printers]
> comment = All Printers
> path = /var/tmp
> printable = Yes
> create mask = 0600
> browseable = No
>
> [print$]
> comment = Printer Drivers
> path = /var/lib/samba/drivers
> write list = @ntadmin root
> force group = ntadmin
> create mask = 0664
> directory mask = 0775
>
> [netlogon]
> comment = Network Logon Service
> path = /var/lib/samba/netlogon
> write list = root
>
> [brandesky20]
> path = /media/BRANDESKY20/
> guest ok = yes
> read only = No
>
> [dan]
> path = /home/dan/
> guest ok = yes
> admin users = dan
> write ok = yes
PV: Make the above, “read only = no”
> --------------------
>
>
> I’m a little unclear on the “force user” thing. What exactly would that
> achieve, versus the other ways of fixing it? Right now, as far as I
> know, I shouldn’t need any username/password to access my samba share.
> Actually, I’m not even quite sure how to set up the username/password
> authentication anyway, although it seems to want it anyway.
>
> -Dan
>
>
Dan;
The default security for samba is “user”. All samba users need a user name
and password in, at least in your case, the smbpasswd file. Add these users
with
smbpasswd -a <username>
where is a valid nix user, this will prompt you for a password.
For example if dan is a valid user on your system, then enter: “smbpasswd -a
dan”. This is done in a terminal window as root. Thus you might have
something like:
su
smbpasswd -a dan
The directory /home/dan is owned by dan and most likely has permissions 0755.
When a file is created via samba in this directory it will have permissions
0700(or 0600) and a directory 0755. So no one but “dan” will have write
permissions. I’m guessing that you are now winding up as guest when you are
accessing this share (i.e. BAD USER). This is actually the nix
account “nobody” and as such you fall in the other category and have no write
access.
If you add to the share [dan],
force user = dan
then anyone who accesses that share will have the same rwx access as “dan” (
it is almost like “su dan”. Any files/directories they create will be owned
by “dan”
Alternatively, you could add:
force create mode = 0777
force directory mode = 0777
This will mean that all the files/directories created via samba will have
rwxrwxrwx permission. In particular, nobody will have write access. The owner
of these files will be the user who created them. Of course for files that
already exist, you will need to go in and change their permissions to
allow “other” access.
You might consider not sharing all of “/home/dan” but rather just a directory
e.g. /home/dan/myshares
–
P. V.
Is this on the test?