To configure Samba to use SMBv2 and disable SMBv1 on Linux or Unix, you need to modify the Samba configuration file, usually located at /etc/samba/smb.conf
. Here are the steps:
- Open the Samba configuration file using a text editor:
sudo nano /etc/samba/smb.conf
- Add the following lines to the end of the file:
min protocol = SMB2
max protocol = SMB3
- Save the changes and close the file.
- Restart the Samba service for the changes to take effect:
sudo service smb restart
- Verify that SMBv1 is disabled by using the following command:
smbclient -m SMB3 -L localhost
You should see a message indicating that the minimum protocol version supported by server
is SMB 2.002
. This confirms that SMBv1 is disabled and that Samba is using SMBv2 by default.