< Previous | Contents | Next >
4.2. Security = User
This section will reconfigure the Samba file and print server, from Section 2, “File Server” [p. 307] and
Section 3, “Print Server” [p. 310], to require authentication.
First, install the libpam-winbind package which will sync the system users to the Samba user database:
sudo apt install libpam-winbind
If you chose the Samba Server task during installation libpam-winbind is already installed.
Edit /etc/samba/smb.conf, and in the [share] section change:
guest ok = no
Finally, restart Samba for the new settings to take effect:
13 http://samba.org/samba/docs/man/Samba-HOWTO-Collection/ServerType.html#id349531
sudo systemctl restart smbd.service nmbd.service
Now when connecting to the shared directories or printers you should be prompted for a username and password.
If you choose to map a network drive to the share you can check the “Reconnect at Logon” check box, which will require you to only enter the username and password once, at least until the password changes.