Hide Windows hidden files and folders that are on Windows network share

25,474

See samba.org/samba/docs/man/manpages-3/smb.conf.5.html

There are multiple flags/options which help to hide selected files through Samba share:

# hide files start with a dot (.)
hide dot files = yes

# hide selected files. example files start with ($)
hide files = /$*/

# hide pipes, sockets, devices ...
hide special files = yes

# hide files with no read permissions
hide unreadable = yes

# hide files with no write permissions
hide unwriteable files = yes

In most distributions, The configuration could be found at /etc/samba/smb.conf

As a new user run this in terminal (advise: make a backup):

sudo gedit /etc/samba/smb.conf

Then restart samba service

sudo service samba restart

If you want Global share options insert those lines before the sections with ([]). Otherwise with specific options for a shared path, put lines under the needed section or create new one. Example:

[foo]
path = /home/bar
read only = yes
hide dot files = yes
Share:
25,474

Related videos on Youtube

Trihta
Author by

Trihta

Updated on September 18, 2022

Comments

  • Trihta
    Trihta over 1 year

    I have fileserver based o Windows Server 2008 R2, that has some shares with hidden files on them. FS on which shares are created is NTFS Now I've mounted those shares in ubuntu using CIFS, everything is working fine except that I can see all the hidden files, which is expected, but not desired. Is there any possible way not to display those files in ubuntu?

    I found that thread:http://ubuntuforums.org/showthread.php?t=1882753&s=c2495b99639759e45b80953f131d3d97, that says that this is possible if mounting ntfs partition. Any possible way to acomplishe this using cifs? maybe mounting netowk share using ntfs; would this work?

    • Rinzwind
      Rinzwind over 10 years
      Did you check the config file for samba? See samba.org/samba/docs/man/manpages-3/smb.conf.5.html from where they 1st talk about "hidden"?
    • Trihta
      Trihta over 10 years
      One more thing. It would help a lot if i could just hide system folders like $RECYCLE.BIN and temp word files which starts with ~$
    • Rinzwind
      Rinzwind over 10 years
      That will probably be hide files = /$*/
    • Trihta
      Trihta over 10 years
      I know it's dumb question, but where do i put that?
  • Rinzwind
    Rinzwind over 10 years
    That is what is asked ;)
  • Daniel Marschall
    Daniel Marschall almost 6 years
    Note that at some systems, the restart command is sudo service smbd restart