Exact same question as this one, but using CLI instead of GUI.
I'd like to allow login access to a shared SMB directory, but the users get no other access to the server.
42 Answers
- Create a user on the server:
sudo adduser --no-create-home --disabled-password --disabled-login sambausername
- Add that user to samba (you'll be asked to type a password):
sudo smbpasswd -a sambausername
Create a share by editing
/etc/samba/smb.conf. For example, you can add something like this to the bottom:[share name] comment = whatever path = /path to share browsable = yes read only = no guest ok = noNow is a good idea to restart samba:
sudo service smbd force-reload
- Go to the client machine and try to access the share with the username and password you've just set up.
A Note about adding users on Samba version 4.x
Unlike Samba version 3.x and earlier, Samba version 4.x does not require a local Unix/Linux user for each Samba user that is created (if it is connected to another authentication source, like Active Directory).
The command is as follows for adding users into Samba Active Directory
samba-tool user add USERNAME-HEREPlease see Samba AD DC howto for more info
Answer Extracted from Cyberciti
To verify your Samba Version just user the command
samba -VExample Output:
Version 4.3.11-Ubuntu 6