In this article, we will discuss how to disable the use of a specific account's credentials when accessing a Samba share in Windows 10. This can be useful in situations where you want to prevent users from using their main account's password when connecting to a Samba share.
Prerequisites
To follow along with this guide, you will need the following:
- A Windows 10 machine
- A Samba server
- An account on the Samba server with a password
Setting Up Samba
Before we can disable the use of a specific account's credentials for Samba login, we need to set up Samba on our server. This can be done using the following steps:
- Install the Samba package on your server.
- Create a new user on the server for Samba access:
- Set a password for the new user:
- Create a new share for Samba:
sudo useradd sambauser
sudo smbpasswd -a sambauser
[sharedfolder]
path = /path/to/shared/folder
writeable = yes
create mask = 0660
directory mask = 0770
public = no
Disabling Specific Account Credentials for Samba Login
Now that we have set up Samba, we can move on to disabling the use of a specific account's credentials for Samba login. This can be done by editing the Samba configuration file on the server.
- Open the Samba configuration file:
- Add the following line to the file, replacing "mainaccount" with the username of the account whose credentials you want to disable:
- Save and close the file.
sudo nano /etc/samba/smb.conf
map to guest = bad user:mainaccount
This will map any attempts to log in to the Samba share using the "mainaccount" account to a guest account, effectively disabling the use of the account's credentials for Samba login.
Testing the Configuration
To test the configuration, try connecting to the Samba share from a Windows 10 machine using the "mainaccount" and its password. The connection should fail, as the credentials have been disabled for Samba login.
Next, try connecting to the Samba share using a different account and its password. The connection should succeed, as we have not disabled the use of this account's credentials for Samba login.
In this article, we have discussed how to disable the use of a specific account's credentials when accessing a Samba share in Windows 10. We covered the following steps:
- Setting up Samba
- Disabling specific account credentials for Samba login
- Testing the configuration