Mounting SMB (Cifs) sharer on Centos 7

peteforde

Dabbler
Joined
Oct 27, 2021
Messages
18
I have created a SMB share on my TrueNas

I am trying to mount it to CentOS as a SMB share. Using the command:

sudo mount -t cifs //xx.xx.xx.xx/mnt/point /mnt/point

this fails to mount as a root user and also a Active Directory user

mount error(13): Permission denied

Any work arounds
 

peteforde

Dabbler
Joined
Oct 27, 2021
Messages
18
//xx.xx.xx.xx/mnt/point

should be "//<ip or netbios name>/<share name>"

root user is not permitted for SMB authentication.

All of which I have done above. You also have to include the -t option. AD user can also not mount
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
All of which I have done above. You also have to include the -t option. AD user can also not mount
Okay. Check output of `midclt call smb.status AUTH_LOG | jq`. Verify that credentials are being passed correctly. AD creds should be of either form DOMAIN\\username or username@domainname. mount.cifs will should prompt for password.
 

peteforde

Dabbler
Joined
Oct 27, 2021
Messages
18
interesting:

"timestamp": "2021-12-08T10:24:21.776559-0800",
"type": "Authentication",
"Authentication": {
"version": {
"major": 1,
"minor": 2
},
"eventId": 4625,
"logonId": "0",
"logonType": 3,
"status": "NT_STATUS_NO_SUCH_USER",
"localAddress": "ipv4:xx.xx.xx.xx:445",
"remoteAddress": "ipv4:xx.xx.xx.xx:56076",
"serviceDescription": "SMB2",
"authDescription": null,
"clientDomain": "",
"clientAccount": "pete.forde",
"workstation": "",
"becameAccount": null,
"becameDomain": null,
"becameSid": null,
"mappedAccount": "pete.forde",
"mappedDomain": "",
"netlogonComputer": null,
"netlogonTrustAccount": null,
"netlogonNegotiateFlags": "0x00000000",
"netlogonSecureChannelType": 0,
"netlogonTrustAccountSid": null,
"passwordType": "NTLMv2",
"duration": 3107
}
},
{
"timestamp": "2021-12-08T10:31:44.515756-0800",
"type": "Authentication",
"Authentication": {
"version": {
"major": 1,
"minor": 2
},
"eventId": 4625,
"logonId": "0",
"logonType": 3,
"status": "NT_STATUS_NO_SUCH_USER",
"localAddress": "ipv4:xx.xx.xx.xx:445",
"remoteAddress": "ipv4:xx.xx.xx.xx:58524",
"serviceDescription": "SMB2",
"authDescription": null,
"clientDomain": "",
"clientAccount": "pete.forde",
"workstation": "",
"becameAccount": null,
"becameDomain": null,
"becameSid": null,
"mappedAccount": "pete.forde",
"mappedDomain": "",
"netlogonComputer": null,
"netlogonTrustAccount": null,
"netlogonNegotiateFlags": "0x00000000",
"netlogonSecureChannelType": 0,
"netlogonTrustAccountSid": null,
"passwordType": "NTLMv2",
"duration": 3157
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Maybe malformed string for username in your mount string. Double-check that user is present in `getent passwd` output on NAS. If it's present, do a smoke-test using smbclient:
smbclient //127.0.0.1/<share> -U "<username from getent output>"
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
Did your TrueNAS machine SID fall out of the tree? Are you joined correctly?
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
If you see in getent passwd output then you're joined correctly.

NT_STATUS_BAD_NETWORK_NAME

Means there's probably a typo in the share name. Verify that you populate `<share name>` in that command with the share name from `testparm -s` output.
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
Are you using the share name or the share path in the UNC? It should be the share name:

SharingSMBAdd.png


Also, do you have any spaces in your name, or special characters?
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554

Another case where NT_STATUS_BAD_NETWORK_NAME can occur is if the share's path no longer exists. Maybe "stat /path/to/share" to make sure it's there. We internally do checks in middleware when generating shares, and in various situations we will remove the share from the running config (like if a dataset gets locked).
 
Top