1/29/2019

SMB Sharing with Windows 10



        SMB, short for Server Message Block often used  interchangeably as SAMBA (which is really a re-implementation of the protocol by a third party) is a Microsoft protocol that predated Active Directory for sharing files between computers. 

        As Microsoft has continued to maintain and develop new versions of SMB, the added security has made it more complicated for users to implement on their home networks. With the removal of Homegroups, SMB has  once again become the de-facto way to share files between computers again.  This is a general tutorial to share files using SMB on windows 10 specifically.

Before you begin. 

         When to use this protocol. SMB works on a client server topography where a computer sharing the file is serving the data to the client who accesses them.  This guide will assume that both computers are on the same network segment and do not require access.

         This guide will assume you have at least  two Windows 10 machines, one to act as server and one to act as client client. for the purpose of this guide I used windows 10 1809 Professional. The two computers are also on the same subnet with connectivity verified with successful pings..   Your experience on other versions of Windows may very.

Step 1 -   Create a User Account to Access the File Share.

         The latest implementation of SMB, forces authentication, and you must use an username and password for an account that exists on the machine acting as server. I have found the best practices for sharing with multiple users and devices is to use an specific account just to access the shares and not an account used by an actual user of the system being used as server.
   
         Got to Settings > Accounts > Family & other users and click "Add someone else to this PC"

  
         Create an LOCAL account. There are two options, create an account for every user you intend on giving access and setting individual rights based on the user OR create an account for multiple users/devices to use for read access. I will show how to set up the latter.

         For a read only account you plan to use on multiple other devices, I suggest a simple and short user name and password you can easily remember to be typed into smaller touch screen device.
   

         Unfortunately Windows will make you set up PW recovery questions. Personally,  I just entered the same BS response since this isn't an account for any one specific person..  If you do set up an account for individual users you may want to take it more seriously.

  
          Now, you've created an account for other devices to access your share, someone could take those credentials and login locally to your machine. This should be avoided for obvious reasons. .  You can disable the account from being able to login locally or (if you have Windows 10 Pro) Remote Desktop. To accomplish this you need to access Group Policy editor.  Go to your search, type "gpedit.msc", and press enter and "Local Group Policy Editor" will launch. WARNING BE CAREFUL! This is a rather powerful tool, only change the specific settings mentioned in this tutorial.
   
         Follow the path of Computer Configuration > Windows Settings > Security Settings > Local Policies > User Rights Assignment (as pictured below.)
   

         Right click "Deny log on locally" and select properties. A new box will open up, click "Add User or Group"
   

         Type the user name previous created and click "Check Names" and if you entered the username correctly it will change to be in the format of hostname/username.


         Click OK to close that box, click ok and then click ok again.  it should list the host/user along with the guest account.

   
          Important!!! repeat same process for "Deny log on through Remote Desktop Services" if you are using the "Professional" version of Windows, other Windows Home doesn't include this feature.
   
Step 2.  Create the Share and Set Permissions.

         With the account is ready, the next step is to create the share and give the user permission to access it. For the folder/directory you intend on sharing, right click the folder icon and select properties..
   
  
         Click on the sharing tab.
   

          In the box that opens up, click where the red arrow is pointing and select the user account previously created in this tutorial.  Then click "add".
 

         If you need to give the user rights to write to upload to the share, change that here

   

         Click share, the window should change to say the folder is shared. Click done and close the properties windows.
   
   
Step 3 - Advertise the Share to Computers on the Local Network (Optional).

         To make your share easier to find on other computers you will need to turn on the "Function Discovery Resource Publication" service.  If you are going to give guests, friends and family access to a network share, this is the easiest way for them to find it. Do no active use this unless you are sure you want everyone with a computer to know you have a SMB share. 

         Type "services.msc" into your windows search and press enter. It will open up "Component Services"
   

         Click "Service(local)" to see the list of local service.
   

         Find "Function Discovery Resource Publication" in the list, right click and select Properties to open up the properties window.
 

         Click "startup type" and set to "Automatic" or "Automatic (Delayed Start)"  then click "OK" to close the window.  Right click on "Function Discovery Resource Publication" again and select "Start" to get it started now without restarting your computer.
   
Step 4. Testing Access to the Share.
  
         Method 1. On your client Computer go to your windows search window or address bar of File Explorer and type two "\" followed by the IP address your server. For example "\\192.168.0.1".  You can also access it with the server's Hostname instead the IP address, for example "\\32BITWIN10-A". 
 

         After you've established the connection, you will have to enter the username and password to achieve access. 
   
         Method 2.  If you did turn on "Function Discovery Resource Publication" service in step3, accessing is even easier. Just got to File Explorer and click on "Network" and your server's hostname should appear.
 

More than Just Windows.   
  
         This share can also accessed by any device that has a SAMBA client, which is pretty much means any device with a network interface these days. You can access this share from Linux. Mac, Android,  and directly access the share from popular media playing applications like Kodi/OpenELEC.  Just make sure your system with the SAMBA share is running.

Debian/Ubunt Package Installation from Default Repositories.

Before you Begin Note: This is meant to be a building upon the previous posts with minimal repetition, the previous post has relevant info...