I am unable to write a text file from a windows PC to a folder in Unix. I am told I have no permission. I can see the unix server from network and browse to the folder but I cannot write to it. The permissions of the folder on the unix is drwxrwxrwx.

How can I agrant rwx permissions of a unix folder to a windows user. You kind assistance would be appreciated

Dani AI

Generated

Quick diagnosis and targeted checks (no fluff)

@ scomrade reported the share is visible from Windows but write attempts fail, and @ CimmerianX correctly suggested checking smb.conf. Common root causes are: Samba mapping the client to a guest/anonymous Unix account even when the share looks writable; the server not recognising Windows domain accounts unless it’s joined and using winbind; OS-level controls (SELinux) blocking smbd from writing; or the underlying filesystem/export (for example an NFS export) forcing anonymous UIDs. See the smb.conf reference for how guest mapping and share permissions behave. (samba.org)

Quick diagnostic checklist (run on the Unix server)

sudo testparm -s                      # validate smb.conf and show effective settings
sudo smbstatus -S                     # show current shares and which unix user is used
ls -ld /path/to/share                 # confirm unix owner/group and mode
getfacl /path/to/share                # show POSIX ACLs if present
mount | grep /path/to/share           # is the path an NFS or special mount?
ls -Zd /path/to/share                 # SELinux file context
sudo tail -n 200 /var/log/samba/*     # look for permission-denied or auth messages

Using the above will reveal whether smbd is letting the client in as a guest account (common when guest ok is used), or whether the client authenticates but maps to a Unix user that lacks write rights. testparm and smbstatus are the canonical tools for this. (samba.org)

Fix paths depending on the cause

  • If connections are being mapped to the guest account, either disable anonymous access or change the share to force an appropriate unix identity (or adjust the guest account) so writes use a known user that has ownership. The Samba docs explain guest handling and security modes. (samba.org)
  • If the Windows name is a domain account, either create a matching local Unix/Samba account (and populate Samba’s password DB) or join the server to the AD/domain and use winbind/idmap so domain users become usable Unix principals. The Samba domain-member / winbind guides cover both approaches. (wiki.samba.org)
  • If SELinux is enforcing, Samba will be blocked even with correct Unix perms; label the tree with samba_share_t or enable the appropriate SELinux boolean for exports. If the path is an NFS export, check root_squash/anon mapping. (docs.redhat.com)

Summary: determine the effective Unix UID that Samba is using (logs + smbstatus). That one fact points to the right fix: change Samba auth/mapping, fix ownership/ACLs, adjust SELinux labels, or join the domain.

Recommended Answers

All 5 Replies

How are you connecting to the folder? FTP, SMB, NFS?

I have samba on the unix server

So in the smb.conf you should have a section for the Share that you are having issues with.

Something like:
[Share]
path = /blah/blah
valid users = user
browseable = yes

Check to see if you have a "read only" entnry set to yes in the section.

That would be my 1st guess.

I have below in my smb.conf
[Data]
path = /gc/cust/valco/data
read only = No
writable = yes
guest ok = Yes

Is samba case sensitive? will add valid users and see the response I will get. Secondly if I have a user on a windows domain like e0152@valcotema, how can I add that or the user should be set up in the Unix?

I'm not not sure if it is case sensitive actually.... I always use lower case in conf files though. Did you change it, what was the result? Now I'm curious about that.

You have to add users to the local host in order to have them access the share when using the "valid users" parameter

smbpasswd -a johndoe

[Share]
path = /blah/blah/
valid users = johndoe
read only = no
browseable = yes

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.