Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to setup a Samba share for file sharing in my intranet.

  1. Is there any way to prohibit some kinds of files (e.g *.exe) from being uploaded to the share folder?

  2. How can I force the user to change their password when logging in for the first time?

share|improve this question
Yes it is possible. I do not have full answer but hint is use veto files option in your configuration file for your first query, which will hide the specified files. Hint for second query is to use pdedit utility. – Sachin Divekar Nov 26 '11 at 14:30

When it comes to file/directory permissions, remember that Samba maps Windows bits to Unix bits.

The Windows' archive bit is mapped to the execute bit. If you want to create files without the x bit, do this:

    map archive = no

More on permissions:

share|improve this answer
I think the question is asking how can they stop someone from putting files with a certain extension on the file server, not so much how to stop them from executing the file (which can also be done through normal file permissions via chmod 400 file) – txtechhelp Jul 11 '15 at 6:13
From my Googling an issue with not wanting my files to be +x when some were shared over samba for Windows devs, this really helped me out. Thanks! – Leonard Challis Feb 29 at 9:40

I found a great tutorial on this from RedHatLinux.


Step 1.mkdir /samba
Step 2.chmod a+w /samba
Step 3.yum install samba -y
Step 4.vim /etc/samba/smb.conf
        comment = Only users
        path = /samba
        public = yes
        writable = yes
        printable = no
        write list = +staff
Step 5.service smb restart


Step 1.If browseable=yes ->we CAN see the shared dir
  If browseable=no -> we CANNOT see the shared dir
Step 2.If public=yes    ->Allows anonymous Login
  If public=no     ->Stops  anonymous Login
Step 3.writable = no     ->uploading is denied  for BOTH the users.
   writable = yes    ->uploading is allowed for BOTH the users
Step 4
     a. writable =no +   ->Allows only u1 to upload files, but
     b. write list =u1   both writable=no and writelist=u1 shuld b enabled
Step 5.hosts allow=127. ->Allow only ip to access share, other ips are denied


Step 1.smbclient -L //  ->List directories shared
Step 2. smbclient //   ->Anonymous Login
   get <file>
   put <file>     
Step 3a. To generat passwd to allow for non-anonymous login
      1. smbpasswd -a u1
      2. service smb restart 
Step 3b. smbclient // -U u1  ->Non Anonymous Login
    get <file>
    put <file>
share|improve this answer
looks useful,I will take a look and thanks a lot – husean Nov 28 '11 at 4:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.