This establishes three shares:[global] workgroup = lab265 dos charset = cp850 unix charset = ISO-8859-1 log file = /var/log/samba/log.%M vfs objects = audit log level = 0 vfs:2 max log size = 0 [networking] path = /srv/networking valid users = john,jack,jill writeable = yes [homes] comment = Home Directories browseable = no writable = yes [printers] comment = All Printers path = /var/spool/samba browseable = no guest ok = no printable = yes
Your smb.conf file does not contain this share.
You could restrict access to this share to the server (both IP addresses) and the local network, as follows:For each user to log in, you need to create a UNIX user (using useradd -m) and add that user to the samba passwd file usinghosts allow = 127.0.0.1 192.168.1.150 192.168.1.If restricting access by IP address, your IP address must be in the list for you to access the share.
hosts deny = 0.0.0.0/0.0.0.0
smbpasswd -a userThe username and password used in the smbpasswd command must be those used to connect to the share from the client.
a printer share (which would include all defined printers).
Logging is to a separate file for each host; audit information on file access goes to the system log file (level 2 = directory operations plus file open and close).
smbclient -L netbiosname -U testto list shares available from a samba server.
This must be done slightly differently when accessing a Windows server:smbclient -L actual_netbiosname -I IP_address -U user_nameHowever, it may not be possible to list available shares on a Windows 7 or Vista system using smbclient. Those versions use Link-local Multicast Name Resolution (llmnr) to the multicast address 18.104.22.168 in order to implement network discovery. You can try turning off network discovery on the Windows side (to force it to use WINS), or you can try adding wins to /etc/nsswitch.conf after "dns" on the hosts line.
smbclient //actual_netbiosname/share name -U user_nameYou will then enter the smb shell; available commands include
smbspool smb://host/printer local.fileSee /usr/doc/samba-4.0.9/swat/help/welcome.html for more details.
Check it with testparm and restart samba. Check the tail of the system log file, as well as the samba log files.
- Add the linenetbios name = cnnn(where nnn is your PC number) to the global section.
- Change the workgroup to "islandn" (where n = 1, 2, 3 or 4).
- Add a private share for payroll users tom, dick and harry.
echo name>name in each of their home directories. echo payroll>payroll in the /srv/payroll directory.
Use smbclient, both from your PC and from another, to examine and modify the files in their shares.
net use drive-letter: \\IP-address\homesEnter the appropriate user and password, and open the share (from My Computer). To un-mount, right click on the drive letter and choose "Disconnect".
Open it from your PC using Linux and smbclient.
©2015, Kenneth R. Koehler. All Rights Reserved. This document may be freely reproduced provided that this copyright notice is included.
Please send comments or suggestions to the author.