hassio-addons icon indicating copy to clipboard operation
hassio-addons copied to clipboard

NT_STATUS_WRONG_PASSWORD

Open TheLexus opened this issue 2 years ago • 4 comments

Hi.

I always get the response NT_STATUS_LOGON_FAILURE if I try to access my Synology nas using samba-backup. If I try the same from my Mac Box its working. Here is the command I used there without problems:

mount_smbfs //smarthome:[email protected]/backups/smarthome /tmp/test

I double and triple checked all the settings and especially the password. Everything seems to be correct but I only get an auth error.

I even tried to simply access the config share created by the samba-share add-on for ha. Its exact the same problem. I would try to start the samba-backup container and try using smbclient (or whatever command is existing there) but the container does not start of course...

I tried it even successfully with the smbclient command run from the debian system that hosts the HA instance:

smbclient -v -U "smarthome"%"PASSWORD" "//nas.local/backups" -c exit

Log of samba-backup:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[22-06-28 09:20:08] INFO: ---------------------------------------------------
[22-06-28 09:20:08] INFO: Host/Share: NAS.local/backups
[22-06-28 09:20:08] INFO: Target directory: smarthome
[22-06-28 09:20:08] INFO: Keep local/remote: 10/10
[22-06-28 09:20:08] INFO: Trigger time: manual
[22-06-28 09:20:08] INFO: ---------------------------------------------------
[22-06-28 09:20:08] DEBUG: Backups local: 0
[22-06-28 09:20:08] DEBUG: Backups remote: 0
[22-06-28 09:20:08] DEBUG: Total backups succeeded: 0
[22-06-28 09:20:08] DEBUG: Total backups failed: 0
[22-06-28 09:20:08] DEBUG: Last backup: never
[22-06-28 09:20:08] DEBUG: API Status: 200
[22-06-28 09:20:08] DEBUG: API Response: {"entity_id": "sensor.samba_backup", "state": "IDLE", "attributes": {"friendly_name": "Samba Backup", "backups_local": "0", "backups_remote": "0", "total_backups_succeeded": "0", "total_backups_failed": "0", "last_backup": "never"}, "last_changed": "2022-06-28T07:20:08.707813+00:00", "last_updated": "2022-06-28T07:20:08.707813+00:00", "context": {"id": "01G6MJX2R3DS03PTFD4HJZNAT7", "parent_id": null, "user_id": "b7edf2621ab24f2c8e4b14dc9b9161fd"}}
[22-06-28 09:20:08] WARNING: session setup failed: NT_STATUS_LOGON_FAILURE
[22-06-28 09:20:08] FATAL: Cannot access share. Login failed. Please check your credentials.
[22-06-28 09:20:08] DEBUG: API Status: 200
[22-06-28 09:20:08] DEBUG: API Response: {"entity_id": "sensor.samba_backup", "state": "FAILED", "attributes": {"friendly_name": "Samba Backup", "backups_local": "0", "backups_remote": "0", "total_backups_succeeded": "0", "total_backups_failed": "0", "last_backup": "never"}, "last_changed": "2022-06-28T07:20:08.829383+00:00", "last_updated": "2022-06-28T07:20:08.829383+00:00", "context": {"id": "01G6MJX2VXJ4WH6JQKSBD299QB", "parent_id": null, "user_id": "b7edf2621ab24f2c8e4b14dc9b9161fd"}}
[cmd] /run.sh exited 1
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.

Configuration of samba-backup:

host: NAS.local
share: backups
target_dir: smarthome
username: smarthome
password: PASSWORD
keep_local: '10'
keep_remote: '10'
trigger_time: manual
trigger_days:
  - Mon
  - Tue
  - Wed
  - Thu
  - Fri
  - Sat
  - Sun
exclude_addons: []
exclude_folders: []
log_level: debug
workgroup: NAS
compatibility_mode: false

log.smbd for the mount_smbfs login

{"timestamp":"2022-06-28T09:48:51.436517+0200","type":"Authentication","Authentication":{"version":{"major":1,"minor":1},"eventId":4624,"logonType":3,"status":"NT_STATUS_OK","localAddress":"ipv6:fe80::211:32ff:fe5d:2e13:445","remoteAddress":"ipv6:fe80::1478:c369:6d3a:6e71:49783","serviceDescription":"SMB2","authDescription":null,"clientDomain":"NAS","clientAccount":"smarthome","workstation":"IMACNINO","becameAccount":"smarthome","becameDomain":"NAS","becameSid":"S-1-5-21-1086850971-993202404-1539049235-3068","mappedAccount":"smarthome","mappedDomain":"NAS","netlogonComputer":null,"netlogonTrustAccount":null,"netlogonNegotiateFlags":"0x00000000","netlogonSecureChannelType":0,"netlogonTrustAccountSid":null,"passwordType":"NTLMv2","duration":14039}}

log.smbd for the samba-backup login

{"timestamp":"2022-06-28T09:18:32.785402+0200","type":"Authentication","Authentication":{"version":{"major":1,"minor":1},"eventId":4625,"logonType":3,"status":"NT_STATUS_WRONG_PASSWORD","localAddress":"ipv4:192.168.2.2:445","remoteAddress":"ipv4:192.168.2.30:55722","serviceDescription":"SMB2","authDescription":null,"clientDomain":"NAS","clientAccount":"smarthome","workstation":"15D21743-SAMBA-BACKUP","becameAccount":null,"becameDomain":null,"becameSid":null,"mappedAccount":"smarthome","mappedDomain":"NAS","netlogonComputer":null,"netlogonTrustAccount":null,"netlogonNegotiateFlags":"0x00000000","netlogonSecureChannelType":0,"netlogonTrustAccountSid":null,"passwordType":"NTLMv2","duration":11632}}

TheLexus avatar Jun 28 '22 08:06 TheLexus

I would try to start the samba-backup container and try using smbclient (or whatever command is existing there) but the container does not start of course...

For debugging purposes, you could set the skip_precheck option to true. This way the add-on keeps running.

thomasmauerer avatar Jul 01 '22 16:07 thomasmauerer

I have the same issue, should I also disable prechecks and wait for the triggern?

z4ch523 avatar Jul 11 '22 18:07 z4ch523

@TheLexus Please remove the workgroup option and try again. Your smbclient command which works from Debian does not specify a workgroup.

@z4ch523 My idea with skip_precheck was only that the add-on keeps running, so you can attach to it for debugging purposes. Otherwise the add-on will shut down. Using this option will not solve your issue.

thomasmauerer avatar Jul 12 '22 18:07 thomasmauerer

Sorry for the late reply. To sum it up... it seems to be my fault and i used a wrong password (and yes, i triple checked that but there was a minor typo...) Here is what i did to verify it:

  • first enable the skip-precheck at the addon (as thomas said).
  • start samba-backup
  • get an ssh terminal on your homeassistant server (depends on you installation type, if you use homeassistant-os you need the ssh addon or better the community terminal & ssh addon configured)
  • get a shell at the samba_backup container docker exec -it addon_15d21743_samba_backup bash
  • run the same command samba_backup uses todo the precheck smbclient -v -U "HOSTNAME"%"PASSWORD" "//SHARE/DIRECTORY"

Check whatever the command told you, test and play around until its working, afterwards samba_backup will work too.

TheLexus avatar Jul 13 '22 09:07 TheLexus