Ubuntu 20.04 - Xubuntu 20.04 - Samba COMPLETE samba.conf file.

    • 239 posts
    July 30, 2020 9:10 PM PDT

    Ubuntu 20.04 and it's offspring (Xubuntu, Mint...) neglected to add the repositories for the GUI which makes it super simple to use.
    But these instructions should also make it very simple to do. No not as fast or easy as the GUI but if you need it it's pretty fast and super easy. 

    This is for sharing on your computer NOT SETTING UP A SAMBA SERVER.

    Open your favorite Terminal then type or copy and paste these in.
    First Stop Samba:
    Type or copy and paste this hit enter: sudo service smbd stop

    Then back-up the original file just in case.
    Type or copy and paste this hit enter: sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup

    Then edit the samba config file.
    Type or copy and paste this hit enter: sudo nano /etc/samba/smb.conf

    You should see something like this.

    This IS A WORKING CONFIG FILE COPY & PASTE, change the name of your computer, change hosts allow to your IP number, add your share folders. Add your username, add your password and your Samba will work. Tested on Linux to Linux. REMOVE the # if you want to use that part I don't add private area's to Samba. I only like sharing folders I add and printers. You can also remove every line with a # those are just notes or instructions.

    [global]
    netbios name = AMD-BEAST (YOUR COMPUTER NAME HERE)
    security = user
    workgroup = workgroup
    server string = %h server
    log file = /var/log/samba/samba.log
    max log size = 1000
    dns proxy = No
    hosts allow = 127. 192.168.1. (192.168.1. should match first 3 groups in YOUR ROUTER)
    hosts deny = false
    cups options = raw
    printing = cups
    printcap name = cups

    [printers]
    comment = All Printers
    path = /var/spool/samba
    browseable = yes
    writable = no
    guest ok = no
    public = no
    printable = yes
    locking = no
    strict locking = no

    [print$]
    path = /var/lib/samba/printers

    #[Public Directory]
    #path = /Public/Files
    #guest ok = yes
    #read only = no
    #browseable = yes

    #[Private Directory]
    #path = /private/files/
    #valid users = beast
    #read only = yes
    #browseable = no


    # Add the drive or folder/s you would like to share "[software] (The Share Name)"
    # To share just one folder on the drive it would look like this path = /media/YOUR USERNAME/software/linux
    # You can copy and paste the settings below and just add you share name, username, the drive or folder you want to share.
    # Add as many entries as you would like to share leaving a single line space between each entry.

    [software]
    path = /media/YOUR USERNAME/software/software
    # path = /media/Bill/home/pictures 
    writeable = yes
    browseable = yes
    valid users = YOUR USERNAME 
    # if you have more then one user it should look like this: valid users = jim, joe, allen, bill
    # You will need to recreate this group for each shared folder.

    Then hit the Ctrl key + x when it asks you to save the file say Y = YES
    Then it will ask the name to save it as don't change anything just hit enter.

    Then run these:
    Restart Samba:
    Type or copy and paste this hit enter: sudo service smbd restart or sudo systemctl restart smbd

    Add user and password to Samba: (If you have more then one user run this for each user)
    Type or copy and paste this hit enter: sudo smbpasswd -a YOUR USERNAME
    Type in a password (it can be your log into linux password - hit the enter key)
    Retype password hit the enter key.

    You should see this:
    Added user YOUR USERNAME.

    Go to Networking and look for the NAME OF YOUR COMPUTER
    All done you should be able to see and access your shared drives and or folders on any Linux, Windows 7, 8, 8.1 computer, laptop, tablet.

    This should work in any OS if you don't see your computer listed. In EVERY OS BUT WINDOWS 10 you will only need to do it ONE TIME.
    Windows 10 as everyone knows is garbage if you don't see your computer listed like always.
    Click on Network, in the address bar type in the name of your computer hit enter.
    Like this: \\COMPUTERNAME
    It is Windows 10 so you may need to do it three to five times. Every time Windows 10 will say it's not there don't give up, don't bother with trouble shooter just keep pasting it in hitting enter. Then like magic the computer it couldn't find will appear! LOL Windows 10!

    As always any questions just ask!


    This post was edited by beastusa at October 28, 2021 6:43 AM PDT