Hallo zusammen,
ich habe vor langer Zeit mal Samba auf meine Ubuntu-Server eingerichtet und es lief auch schon mal recht gut.
Aktuell möchte ich Handy-Backup auf dem Server machen. Hierzu soll ich Username und Passwort des NAS eingeben. Ich habe daraufhin ein Freigabe der Samba-Conf hinzugefügt, ein Linux-User (ohne Home) eingerichtet und auch einen Sambauser erstellt.
Leider musste ich feststellen das der Username/Passwort irgendwie nicht passt.
Als nächstes habe ich auf dem Laptop ein Mount-Verzeichnis erstellt und dies in die FSTAB eingetragen :
$ cat /etc/fstab # /etc/fstab: static file system information. ... gekürzt //192.168.xx.xx/HandyBackup /media/HaBa cifs auto,username=HBackup,password=passwortbackup,file_mode=0775,dir_mode=0775,uid=1000,gid=1000 0 0
das wird auch mit den beiden Testdateinen angezeigt:
$ ll /media/HaBa/ insgesamt 12 drwxrwxr-x 2 jochen jochen 0 Sep 16 03:37 ./ drwxr-xr-x 10 root root 4096 Sep 16 00:16 ../ -rwxrwxr-x 1 jochen jochen 3116 Sep 16 00:34 Test.txt* -rwxrwxr-x 1 jochen jochen 30 Sep 16 03:37 zeit*
1. wenn ich in die FSTAB username und password der Freigabe des Scanner (auch Samba) eintrage, dann wird das Backupverzeichnis auch eingetragen und das sollte nicht so sein.
2. ich habe weder mit dem Richtigen noch mit dem falschen Zugang einen Schreibzugriff.
$ smbclient -L 192.168.xx.xx Enter WORKGROUP\jochen's password: Anonymous login successful Sharename Type Comment --------- ---- ------- HPScanner Disk NASbackup Disk HandyBackup Disk IPC$ IPC IPC Service (server06 server (Samba, Ubuntu)) HandyBackup1 Disk macht_HBackup SMB1 disabled -- no workgroup available
Ich denke, dass das Problem Serverseitig bei Smaba liegt.
Auf dem Server :
$ smbd -V Version 4.11.6-Ubuntu
$ testparm Load smb config files from /etc/samba/smb.conf Unknown parameter encountered: "user" Ignoring unknown parameter "user" Unknown parameter encountered: "user" Ignoring unknown parameter "user" Loaded services file OK. Server role: ROLE_STANDALONE Press enter to see a dump of your service definitions # Global parameters [global] log file = /var/log/samba/log.%m logging = file map to guest = Bad User max log size = 1000 obey pam restrictions = Yes pam password change = Yes panic action = /usr/share/samba/panic-action %d passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* . passwd program = /usr/bin/passwd %u server role = standalone server server string = %h server (Samba, Ubuntu) unix password sync = Yes usershare allow guests = Yes workgroup = HHZ-NETZ idmap config * : backend = tdb [HPScanner] force group = scanner path = /platte/scan read only = No [NASbackup] path = /platte/backup read only = No [HandyBackup] directory mask = 0775 path = /platte/backup/Handy read only = No
die Samba-config
$ cat /etc/samba/smb.conf # # Sample configuration file for the Samba suite for Debian GNU/Linux. # ... gekürzt, alle Kommentare #======================= Global Settings ======================= [global] workgroup = HHZ-NETZ server string = %h server (Samba, Ubuntu) log file = /var/log/samba/log.%m max log size = 1000 logging = file panic action = /usr/share/samba/panic-action %d server role = standalone server obey pam restrictions = yes unix password sync = yes passwd program = /usr/bin/passwd %u passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* . pam password change = yes map to guest = bad user usershare allow guests = yes #======================= Share Definitions ======================= [HPScanner] path = /platte/scan force group = scanner writeable = yes [NASbackup] user = backup01 path = /platte/backup writeable = yes [HandyBackup] user = HBackup path = /platte/backup/Handy writeable = yes directory mask = 0775
Samba neu gestartet :
$ sudo service smbd restart
$ sudo samba-tool user list --username=HBackup Unknown parameter encountered: "user" Ignoring unknown parameter "user" Unknown parameter encountered: "user" Ignoring unknown parameter "user" ltdb: tdb(/var/lib/samba/private/sam.ldb): tdb_open_ex: could not open file /var/lib/samba/private/sam.ldb: No such file or directory Unable to open tdb '/var/lib/samba/private/sam.ldb': No such file or directory Failed to connect to 'tdb:///var/lib/samba/private/sam.ldb' with backend 'tdb': Unable to open tdb '/var/lib/samba/private/sam.ldb': No such file or directory ERROR(ldb): uncaught exception - Unable to open tdb '/var/lib/samba/private/sam.ldb': No such file or directory File "/usr/lib/python3/dist-packages/samba/netcmd/__init__.py", line 186, in _run return self.run(*args, **kwargs) File "/usr/lib/python3/dist-packages/samba/netcmd/user.py", line 534, in run samdb = SamDB(url=H, session_info=system_session(), File "/usr/lib/python3/dist-packages/samba/samdb.py", line 65, in __init__ super(SamDB, self).__init__(url=url, lp=lp, modules_dir=modules_dir, File "/usr/lib/python3/dist-packages/samba/__init__.py", line 115, in __init__ self.connect(url, flags, options) File "/usr/lib/python3/dist-packages/samba/samdb.py", line 81, in connect super(SamDB, self).connect(url=url, flags=flags
hier noch gerade das Verzeichnis auf dem Server:
$ ll /platte/backup/Handy insgesamt 16 drwxrwxr-x 2 jochen jochen 4096 Sep 16 03:37 ./ drwxrwxrwx 13 root root 4096 Sep 16 03:37 ../ -rw-rw-r-- 1 jochen jochen 3116 Sep 16 00:34 Test.txt -rw-rw-r-- 1 jochen jochen 30 Sep 16 03:37 zeit
hier noch erstellen des User :
$ sudo smbpasswd -a HBackup
und :
$ sudo adduser --force-badname --no-create-home --disabled-login --shell /bin/false HBackup
die Samba Verzeichnisse :
$ ll /usr/share/samba/ insgesamt 52 drwxr-xr-x 3 root root 4096 Sep 5 00:43 ./ drwxr-xr-x 171 root root 4096 Jun 23 06:30 ../ -rwxr-xr-x 1 root root 1163 Aug 6 14:17 addshare.py* -rwxr-xr-x 1 root root 2059 Aug 6 14:17 panic-action* -rwxr-xr-x 1 root root 1333 Aug 6 14:17 setoption.py* drwxr-xr-x 5 root root 16384 Sep 5 00:43 setup/ -rw-r--r-- 1 root root 8942 Aug 6 14:17 smb.conf -rwxr-xr-x 1 root root 2682 Aug 6 14:17 update-apparmor-samba-profile* $ ll /usr/share/samba/setup insgesamt 484 drwxr-xr-x 5 root root 16384 Sep 5 00:43 ./ drwxr-xr-x 3 root root 4096 Sep 5 00:43 ../ drwxr-xr-x 3 root root 4096 Sep 5 00:43 adprep/ drwxr-xr-x 2 root root 4096 Sep 5 00:43 ad-schema/ -rw-r--r-- 1 root root 122 Dez 6 2019 aggregate_schema.ldif -rw-r--r-- 1 root root 316 Dez 6 2019 'cn=samba.ldif' -rw-r--r-- 1 root root 423 Dez 6 2019 DB_CONFIG drwxr-xr-x 2 root root 4096 Sep 5 00:43 display-specifiers/ -rw-r--r-- 1 root root 3663 Dez 6 2019 dns_update_list -rw-r--r-- 1 root root 31452 Dez 6 2019 extended-rights.ldif -rw-r--r-- 1 root root 491 Jan 8 2020 fedorads-dna.ldif -rw-r--r-- 1 root root 170 Dez 6 2019 fedorads-index.ldif -rw-r--r-- 1 root root 1206 Jan 8 2020 fedorads.inf -rw-r--r-- 1 root root 813 Jan 8 2020 fedora-ds-init.ldif -rw-r--r-- 1 root root 251 Dez 6 2019 fedorads-linked-attributes.ldif -rw-r--r-- 1 root root 69 Dez 6 2019 fedorads-pam.ldif -rw-r--r-- 1 root root 1095 Jan 8 2020 fedorads-partitions.ldif -rw-r--r-- 1 root root 167 Jan 8 2020 fedorads-refint-add.ldif -rw-r--r-- 1 root root 452 Jan 8 2020 fedorads-refint-delete.ldif -rw-r--r-- 1 root root 386 Dez 6 2019 fedorads-samba.ldif -rw-r--r-- 1 root root 593 Dez 6 2019 fedorads-sasl.ldif -rw-r--r-- 1 root root 121 Dez 6 2019 idmap_init.ldif -rw-r--r-- 1 root root 89 Jan 8 2020 krb5.conf -rw-r--r-- 1 root root 220 Dez 6 2019 memberof.conf -rw-r--r-- 1 root root 37 Dez 6 2019 mmr_serverids.conf -rw-r--r-- 1 root root 246 Dez 6 2019 mmr_syncrepl.conf -rw-r--r-- 1 root root 50 Dez 6 2019 modules.conf -rw-r--r-- 1 root root 1156 Dez 6 2019 named.conf -rw-r--r-- 1 root root 821 Dez 6 2019 named.conf.dlz -rw-r--r-- 1 root root 100 Dez 6 2019 named.conf.update -rw-r--r-- 1 root root 2020 Dez 6 2019 named.txt -rw-r--r-- 1 root root 33 Dez 6 2019 olc_mmr.conf -rw-r--r-- 1 root root 354 Dez 6 2019 olc_seed.ldif -rw-r--r-- 1 root root 41 Dez 6 2019 olc_serverid.conf -rw-r--r-- 1 root root 284 Dez 6 2019 olc_syncrepl.conf -rw-r--r-- 1 root root 248 Dez 6 2019 olc_syncrepl_seed.conf -rw-r--r-- 1 root root 900 Dez 6 2019 prefixMap.txt -rw-r--r-- 1 root root 238 Dez 6 2019 provision_basedn.ldif -rw-r--r-- 1 root root 1907 Dez 6 2019 provision_basedn_modify.ldif -rw-r--r-- 1 root root 37 Dez 6 2019 provision_basedn_options.ldif -rw-r--r-- 1 root root 1510 Dez 6 2019 provision_basedn_references.ldif -rw-r--r-- 1 root root 116 Dez 6 2019 provision_computers_add.ldif -rw-r--r-- 1 root root 306 Dez 6 2019 provision_computers_modify.ldif -rw-r--r-- 1 root root 224 Dez 6 2019 provision_configuration_basedn.ldif -rw-r--r-- 1 root root 18500 Dez 6 2019 provision_configuration.ldif -rw-r--r-- 1 root root 10297 Dez 6 2019 provision_configuration_modify.ldif -rw-r--r-- 1 root root 504 Dez 6 2019 provision_configuration_references.ldif -rw-r--r-- 1 root root 389 Dez 6 2019 provision_dns_accounts_add.ldif -rw-r--r-- 1 root root 572 Dez 6 2019 provision_dns_add_samba.ldif -rw-r--r-- 1 root root 1060 Dez 6 2019 provision_dnszones_add.ldif -rw-r--r-- 1 root root 696 Dez 6 2019 provision_dnszones_modify.ldif -rw-r--r-- 1 root root 252 Dez 6 2019 provision_dnszones_partitions.ldif -rw-r--r-- 1 root root 1928 Dez 6 2019 provision_group_policy.ldif -rw-r--r-- 1 root root 913 Dez 6 2019 provision_init.ldif -rw-r--r-- 1 root root 37210 Dez 6 2019 provision.ldif -rw-r--r-- 1 root root 140 Dez 6 2019 provision_partitions.ldif -rw-r--r-- 1 root root 2139 Dez 6 2019 provision_privilege.ldif -rw-r--r-- 1 root root 1089 Dez 6 2019 provision.reg -rw-r--r-- 1 root root 1135 Dez 6 2019 provision_rootdse_add.ldif -rw-r--r-- 1 root root 169 Dez 6 2019 provision_rootdse_modify.ldif -rw-r--r-- 1 root root 207 Dez 6 2019 provision_schema_basedn.ldif -rw-r--r-- 1 root root 228 Dez 6 2019 provision_schema_basedn_modify.ldif -rw-r--r-- 1 root root 1044 Dez 6 2019 provision_self_join_config.ldif -rw-r--r-- 1 root root 1031 Dez 6 2019 provision_self_join.ldif -rw-r--r-- 1 root root 294 Dez 6 2019 provision_self_join_modify_config.ldif -rw-r--r-- 1 root root 745 Dez 6 2019 provision_self_join_modify.ldif -rw-r--r-- 1 root root 102 Dez 6 2019 provision_self_join_modify_schema.ldif -rw-r--r-- 1 root root 108 Dez 6 2019 provision_users_add.ldif -rw-r--r-- 1 root root 13800 Dez 6 2019 provision_users.ldif -rw-r--r-- 1 root root 298 Dez 6 2019 provision_users_modify.ldif -rw-r--r-- 1 root root 3906 Dez 6 2019 provision_well_known_sec_princ.ldif -rw-r--r-- 1 root root 1842 Dez 6 2019 provision.zone -rw-r--r-- 1 root root 92 Dez 6 2019 refint.conf -rw-r--r-- 1 root root 2184 Dez 6 2019 schema-map-fedora-ds-1.0 -rw-r--r-- 1 root root 1943 Dez 6 2019 schema-map-openldap-2.3 -rw-r--r-- 1 root root 13529 Dez 6 2019 schema_samba4.ldif -rw-r--r-- 1 root root 390 Dez 6 2019 secrets_dns.ldif -rw-r--r-- 1 root root 307 Dez 6 2019 secrets_init.ldif -rw-r--r-- 1 root root 160 Dez 6 2019 secrets.ldif -rw-r--r-- 1 root root 176 Dez 6 2019 secrets_sasl_ldap.ldif -rw-r--r-- 1 root root 149 Dez 6 2019 secrets_simple_ldap.ldif -rw-r--r-- 1 root root 738 Dez 6 2019 share.ldif -rw-r--r-- 1 root root 4363 Jan 8 2020 slapd.conf -rw-r--r-- 1 root root 955 Dez 6 2019 spn_update_list -rw-r--r-- 1 root root 17292 Dez 6 2019 ypServ30.ldif
...
habe gerade festgastellt das ich zwei smb.conf habe die zeite ist unter /etc/samba/smb.conf und wird wohl aktuell benutzt.
$ ll /etc/samba/ insgesamt 84 drwxr-xr-x 3 root root 4096 Sep 16 17:40 ./ drwxr-xr-x 126 root root 12288 Sep 16 14:10 ../ -rw-r--r-- 1 root root 8 Jul 14 2017 gdbcommands -rw-r--r-- 1 root root 9622 Sep 16 17:40 smb.conf -rw-r--r-- 1 root root 9378 Sep 16 02:02 smb.conf.bak -rw-r--r-- 1 root root 9541 Mär 22 2018 smb.conf.ucf-dist -rw-rw-rw- 1 root root 11378 Jun 16 2020 smb.conf.ucf-old -rw-r--r-- 1 root root 9542 Feb 19 2018 smb.org drwxr-xr-x 2 root root 4096 Jul 14 2017 tls/
Kann mal jemand drüber schauen und mir helfen.
Danke und Gruß Jochen