Forum » The Geeks Corner » Linux » Ubuntu - Xubuntu » Ubuntu 20.04 - Xubuntu 20.04 - Samba COMPLETE samba.conf file.

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

  • 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!

    My System:
    Case: Thermaltake Core V71 Tempered Glass.
    Motherboard: Asus Prime TRX40-Pro.
    CPU: AMD Threadripper 3970X@Auto OC.
    Water Block: EK Velocity sTR4 copper & nickel.
    Radiator: Thermaltake Pacific CL429 64mm pure copper.
    Water Pump & Res: 320 GPH Pond Pump, 5 Gallon Reservoir.
    Memory: 64 gigs Corsair Vengeance DDR4-3600 18-19-19-39 CR1.
    Video Card: Asus TUF AMD RX 6900XT OC 16 gigs
    Hard Drives: 1 Crucial 256gig M550, 2 Crucial 2TB SSD's,
    1 WD 10TB 256meg cache, 1 WD 5TB 128meg cache, 2 Seagate 4TB 256meg cache.
    Power Supply: Corsair 1050 watt SINGLE RAIL.
    OS's: LINUX Xubuntu 20.04 LTS x64 and Windows 10 Pro.
    This post was edited by beast-usa (Admin) at October 28, 2021 6:43 AM PDT
      July 30, 2020 9:10 PM PDT
    1