Access Denied When Connecting to Samba; Secruity = ADS
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Access Denied When Connecting to Samba; Secruity = ADS
So after having fun getting Samba-debian to join a Windows 2012R2 domain i have almost all functionality. One problem im now having is if i try to connect to my nas via:
Address Used Response
\\192.168.0.253 The Username or Password is incorrect
\\RMMD-NAS-1 Access Denied
OR by doing
smbclient -L /RMMD-NAS-1 -k
i get
ads_krb5_mk_req: smb_krb5_get_credentials failed for cifs/RMMD-NAS-1@RMMD.INT (Matching credential not found)
cli_session_setup_kerberos: spnego_gen_krb5_negTokenInit failed: Matching credential not found
session setup failed: NT_STATUS_UNSUCCESSFUL
smb.conf
Code:
[global]
server string = Rhodderz NAS
workgroup = RMMD
netbios name = RMMD-NAS-1
realm = RMMD.INT
syslog = 3
dns proxy = no
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
security = ADS
password server = RMMD-SVR-1.RMMD.INT
encrypt passwords = yes
winbind use default domain = yes
winbind enum users = yes
winbind enum groups = yes
winbind separator = +
;winbind normalize names = yes
winbind refresh tickets = yes
idmap uid = 50-9999999999
idmap gid = 50-9999999999
template shell = /bin/bash
ntlm auth = yes
client ntlmv2 auth = yes
client lanman auth = no
log file = /var/log/samba/%m.log
;[homes]
; browseable = no
; comment = Home Directories
; writable = yes
; create mode = 0700
; directory mode = 0700
[share]
;available = yes
comment = Main Root of Share
path = /disk/share
create mask = 777
nt acl support = yes
inherit permissions = no
force group = "RMMD.INT+domain users"
directory mask = 755
writable = yes
valid users = %S
and testparm -s gives
Code:
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
WARNING: The "idmap uid" option is deprecated
WARNING: The "idmap gid" option is deprecated
Processing section "[share]"
Loaded services file OK.
WARNING: The setting 'security=ads' should NOT be combined with the 'password server' parameter.
(by default Samba will discover the correct DC to contact automatically).
'winbind separator = +' might cause problems with group membership.
Server role: ROLE_DOMAIN_MEMBER
[global]
workgroup = RMMD
realm = RMMD.INT
server string = Rhodderz NAS
security = ADS
password server = RMMD-SVR-1.RMMD.INT
syslog = 3
log file = /var/log/samba/%m.log
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
dns proxy = No
template shell = /bin/bash
winbind separator = +
winbind enum users = Yes
winbind enum groups = Yes
winbind use default domain = Yes
winbind refresh tickets = Yes
idmap config * : range = 50-9999999999
idmap config * : backend = tdb
[share]
comment = Main Root of Share
path = /disk/share
valid users = %S
force group = "RMMD.INT+domain users"
read only = No
create mask = 0777
and nsswitch.conf
Code:
passwd: compat winbind
group: compat winbind
shadow: compat
hosts: files dns
networks: files
protocols: db files
services: db files
ethers: db files
rpc: db files
netgroup: compat ldap
Besides the issues pointed out by testparm, there's nothing obviously wrong with your smb.conf. Well, mapping UIDs and GIDs as low as 50 is bound to cause conflicts with existing Linux users and groups, but that's (probably) not what's causing the authentication errors.
(You should drop the "password server" option though, and consider a different winbind separator.)
Can you successfully obtain a Kerberos ticket with kinit AD_user@RMMD.INT? You will be prompted for a password, and a successful authentication attempt will result in no output. klist should then show a ticket.
Does wbinfo -u and wbinfo -g show users and groups from Active Directory?
Does getent passwd and getent group list both local users/groups and users/groups from Active Directory?
Besides the issues pointed out by testparm, there's nothing obviously wrong with your smb.conf. Well, mapping UIDs and GIDs as low as 50 is bound to cause conflicts with existing Linux users and groups, but that's (probably) not what's causing the authentication errors.
(You should drop the "password server" option though, and consider a different winbind separator.)
Can you successfully obtain a Kerberos ticket with kinit AD_user@RMMD.INT? You will be prompted for a password, and a successful authentication attempt will result in no output. klist should then show a ticket.
Does wbinfo -u and wbinfo -g show users and groups from Active Directory?
Does getent passwd and getent group list both local users/groups and users/groups from Active Directory?
i can get a ticket via kinit for both administrator and my main account.
Both wbinfo -u and -g give appropriate repsonses
wbinfo -u
one thing i notice straight away is it has successfully gotten nasmembers from the domain as well (this was the group i was going to use to define what users have access to the shares)
getent doesn't list a single user or group from AD. "nasmembers" must be a local group.
Can you see the computer account object for RMMD-NAS-1 in AD? I suspect the trust relationship may have been broken, which would explain the error message:
Code:
ads_krb5_mk_req: smb_krb5_get_credentials failed for cifs/RMMD-NAS-1@RMMD.INT
(Matching credential not found)
cli_session_setup_kerberos: spnego_gen_krb5_negTokenInit failed: Matching credential not found
You should consider resetting or deleting the account object and run net ads join again.
Edit: And if you do, consider deleting the idmap database and changing the idmap parameters so that they don't totally obliterate all your local accounts and groups.
getent doesn't list a single user or group from AD. "nasmembers" must be a local group.
Can you see the computer account object for RMMD-NAS-1 in AD? I suspect the trust relationship may have been broken, which would explain the error message:
Code:
ads_krb5_mk_req: smb_krb5_get_credentials failed for cifs/RMMD-NAS-1@RMMD.INT
(Matching credential not found)
cli_session_setup_kerberos: spnego_gen_krb5_negTokenInit failed: Matching credential not found
You should consider resetting or deleting the account object and run net ads join again.
NasMembers has only been created on the controller. RMMD-NAS-1 is in the AD. removing it and rejoining with "net ads join -U administrator" joins successfully with the response of
Code:
Using short domain name -- RMMD
Joined 'RMMD-NAS-1' to dns domain 'rmmd.int'
but still can not access the shares and "smbclient -L /RMMD-NAS-1 -k" still gives the same error. it did before give Logon_Denied but cant get it back to that state.
The Kerberos error clearly says that a credential could not be found. Does the SPN even exist? I don't have a Windows server handy right now, but I believe setspn -L RMMD-NAS-1 should list SPNs associated with that computer account.
The Kerberos error clearly says that a credential could not be found. Does the SPN even exist? I don't have a Windows server handy right now, but I believe setspn -L RMMD-NAS-1 should list SPNs associated with that computer account.
setspn -L RMMD-NAS-1 gives
Code:
Registered ServicePrincipalNames for CN=rmmd-nas-1,CN=Computers,DC=rmmd,DC=int:
HOST/rmmd-nas-1.rmmd.int
HOST/RMMD-NAS-1
OK. Actually, wbinfo should have failed if the account trust relationship wasn't working.
That leaves the issue of the non-functinal getent. The accounts and groups listed are definitely all local, including "nasusers". Domain accounts should appear in the format "DOMAIN[winbind_separator]account".
In almost all cases where getent fails to enumerate AD accounts even though wbinfo works, the idmap configuration is to blame (like in this case, which is just one of many that turn up if you do a Google search). Try changing the idmap settings to the proper syntax and delete the existing database.
OK. Actually, wbinfo should have failed if the account trust relationship wasn't working.
That leaves the issue of the non-functinal getent. The accounts and groups listed are definitely all local, including "nasusers". Domain accounts should appear in the format "DOMAIN[winbind_separator]account".
In almost all cases where getent fails to enumerate AD accounts even though wbinfo works, the idmap configuration is to blame (like in this case, which is just one of many that turn up if you do a Google search). Try changing the idmap settings to the proper syntax and delete the existing database.
Hi again,m sorry for being a pain, still slightly new to this sort of error (didnt have a problem when samba was the domain controller) i have changed my global to this:
Code:
[global]
server string = Rhodderz NAS
workgroup = RMMD
netbios name = RMMD-NAS-1
realm = RMMD.INT
syslog = 3
dns proxy = no
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
security = ADS
encrypt passwords = yes
winbind use default domain = yes
winbind enum users = yes
winbind enum groups = yes
winbind separator = +
idmap config * : backend = tdb
idmap config * : range = 100001-200000
idmap config RMMD.INT : backend = ad
idmap config RMMD.INT : range = 100001-200000
idmap config RMMD.INT : base_rid = 0
template shell = /bin/bash
ntlm auth = no
client ntlmv2 auth = yes
lanman auth = no
log file = /var/log/samba/%m.log
restarted, blanked the cache/db and rejoined the domain but i still get the error. I know the error is staring me in the face but with my lack of experiance im not sure what it is. Getent still doesnt have any of the domain users or gourps either
Edit:
I rebooted after deleting the cache and let samba start naturally
Now smbclient -L /RMMD-NAS-1 -k gives me
"session setup failed: NT_STATUS_ACCESS_DENIED"
Last edited by Rhodderz; 03-28-2014 at 02:07 PM.
Reason: Rebooted fully instead of restarting the service
I see you've changed the idmap backend to "ad". That requires RFC 2307 extensions in the AD schema, and I don't think they exist by default. (Other than that, RFC 2307 provides a great way to store Unix-related information in directory services.)
Unless you actually have the RFC 2307 extensions in your AD schema, you should use the tdb or rid backends (the latter doesn't require a database at all).
I see you've changed the idmap backend to "ad". That requires RFC 2307 extensions in the AD schema, and I don't think they exist by default. (Other than that, RFC 2307 provides a great way to store Unix-related information in directory services.)
Unless you actually have the RFC 2307 extensions in your AD schema, you should use the tdb or rid backends (the latter doesn't require a database at all).
Ah i did not knwo that, sorry my bad. I have changed it to tdb (and tried rid) but now i still get NT_STATUS_ACCESS_DENIED
unfortunatley it hasnt :/ and as soon as i rebooted it went back to the error which is a tad frustrating as i didnt change anything. tried rejoining the domain with the same downside. also if i do wbinfo -u or -g i get the appropriate response but when i do -i rhodderz i get
failed to call wbcGetpwnam: WBC_ERR_DOMAIN_NOT_FOUND
Could not get info for user rhodderz
If i change backend to ad and add the schemea_mode to rfc2307 (which apparenlty (dont take my word as i keep seeing this pop up on random forums) 2012+ uses this by default) i can then do wbinfo -i rhodderz and i get
rhodderz:*:101104:101121:Rhodri Metcalfe-Davies:/home/RMMD/rhodderz:/bin/bash
Thanks for helpin this far by the way.
EDIT:
i removed ads and put the backend back to tdb and i still get the infor as above when i do wbinfo -i rhodderz
and when i did smbclient -L /RMMD-NAS-1 -k i got
NT_STATUS_LOGON_FAILURE
this is after i kinit my admin account.
Last edited by Rhodderz; 03-28-2014 at 06:56 PM.
Reason: New info
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.