Tips for finding Knowledge Articles

  • - Enter just a few key words related to your question or problem
  • - Add Key words to refine your search as necessary
  • - Do not use punctuation
  • - Search is not case sensitive
  • - Avoid non-descriptive filler words like "how", "the", "what", etc.
  • - If you do not find what you are looking for the first time,reduce the number of key words you enter and try searching again.
  • - Minimum supported Internet Explorer version is IE9
Home  >
article

KB-10577: Get NT_STATUS_ACCESS_DENIED error when try to list files after connecting to samba share

27 June,18 at 03:49 AM

Problem:  

When trying to do a listing after connecting to a samba share from the local system via smbclient, the following error is seen.
 
[user@server ~]$ smbclient //localhost/samba-test
Enter CENTRIFY\user's password:
Domain=[CENTRIFY] OS=[Windows 6.1] Server=[Samba 4.6.2]
smb: \> ls
NT_STATUS_ACCESS_DENIED listing \*


 
Cause:

This is caused by SELinux not being configured to allow Samba or smbclient to see the share listing.


Resolution:

1. SELinux can be set to permissive. (Will need to be run as root or root equivalent user).
 
[root@server ~]# setenforce permissive

or

2. SELinux can be allowed to work with Samba

Search for the SELinux settings for Samba with the following command:
 
[user@server ~]$ getsebool -a | grep 'samba\|smb'
samba_create_home_dirs --> off
samba_domain_controller --> off
samba_enable_home_dirs --> off
samba_export_all_ro --> off
samba_export_all_rw --> off
samba_load_libgfapi --> off
samba_portmapper --> off
samba_run_unconfined --> off
samba_share_fusefs --> off
samba_share_nfs --> off
sanlock_use_samba --> off
smbd_anon_write --> off
tmpreaper_use_samba --> off
use_samba_home_dirs --> off
virt_use_samba --> off

Set the samba_export_all_ro setting to on. (Will need to be root or root equivalent user).
 
[root@server ~]# setsebool -P samba_export_all_ro on

The listing should now show the share contents.
 
[user@server ~]$ smbclient //localhost/samba-test
Enter CENTRIFY\user's password:
Domain=[CENTRIFY] OS=[Windows 6.1] Server=[Samba 4.6.2]
smb: \> ls
  .                                   D        0  Mon Sep 18 13:48:40 2017
  ..                                 DR        0  Mon Sep 18 13:48:40 2017

        15718400 blocks of size 1024. 11682584 blocks available
smb: \>

Still have questions? Click here to log a technical support case, or collaborate with your peers in Centrify's Online Community.