Win10 is in the same LAN and was used normally a few days ago. I don’t remember modifying the smbd file, but suddenly I can’t access the ubuntu shared folder. After checking with win10, an error message says that the smbd service of the remote folder may not be started; I use the following command to try restarting smbd
sudo service smbd restart
output
Job for smbd.service failed because the control process exited with error code.
See "systemctl status smbd.service" and "journalctl -xe" for details.
It is recommended to use the following command for specific troubleshooting
sudo smbd -iS
#或者
sudo smbd -FS
My output reports an error:
smbd version 4.7.6-Ubuntu started.
Copyright Andrew Tridgell and the Samba Team 1992-2017
invalid permissions on directory '/var/lib/samba/private/msg.sock': has 0755 should be 0700
It means I don’t know what’s going on. There is an incorrect permission. Make some changes according to the output instructions:
sudo chmod 0700 /var/lib/samba/private/msg.sock
Restarted again smbd
, but the error remains
sudo service smbd restart
use againsudo smbd -iS
smbd version 4.7.6-Ubuntu started.
Copyright Andrew Tridgell and the Samba Team 1992-2017
tdb(/var/lib/samba/registry.tdb): tdb_rec_read bad magic 0x0 at offset=525988
tdb(/var/lib/samba/registry.tdb): tdb_rec_read bad magic 0x0 at offset=525988
tdb(/var/lib/samba/registry.tdb): tdb_rec_read bad magic 0x0 at offset=525988
tdb(/var/lib/samba/registry.tdb): tdb_rec_read bad magic 0x0 at offset=525988
tdb(/var/lib/samba/registry.tdb): tdb_rec_read bad magic 0x0 at offset=525988
tdb(/var/lib/samba/registry.tdb): tdb_rec_read bad magic 0x0 at offset=525988
tdb(/var/lib/samba/registry.tdb): tdb_rec_read bad magic 0x0 at offset=525988
regdb_store_keys: Failed to store new record for key [HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Group Policy]: WERR_GEN_FAILURE
Failed to initialize data in registry!
STATUS=daemon failed to start: Samba cannot init registry, error code 13
try to delete/var/lib/samba/registry.tdb
sudo rm /var/lib/samba/registry.tdb
Finally started smbd again successfully!