Overslaan naar inhoud
  • +31 653-919-302
Cafayate.Net
  • 0
  • 0
  • Aanmelden
  • Nederlands English (US) Español (AR)
  • Contact
  • Startpagina
  • Blog
  • Vacatures
  • Contact
Cafayate.Net
  • 0
  • 0
    • Startpagina
    • Blog
    • Vacatures
    • Contact
  • +31 653-919-302
  • Nederlands English (US) Español (AR)
  • Aanmelden
  • Contact

Setup File server on ubuntu 14.04 ( Samba )

  • Alle blogs
  • Tech Blog
  • Setup File server on ubuntu 14.04 ( Samba )
  • 5 maart 2021 in
    Administrator

     

    Samba is a free software used to enable file and print services on unix-like systems. It runs on most unix variants, such as Linux, AIX, Solaris and BSD.
    This article helps you to set up file server on ubuntu 14.04 server. This article contains steps for creating both anonymous ( without username and password ) and secured shares .
    1. Anonymous share.
    2. Secured share.
    3. User creation.

    Setup File server on ubuntu 14.04

    Step 1 » Install samba packages after updating repositories
    krizna@leela:~$ sudo apt-get update
    krizna@leela:~$ sudo apt-get install samba samba-common python-glade2

    Creating Anonymous share

    Everyone can access and store files without username and password .
    Step 2 » Create folder for Anonymous share.
    krizna@leela:~$ sudo mkdir -p /shares/anonymous
    Step 3 » Change the ownership to nobody so that everyone can access and store files in that folder.
    krizna@leela:~$ sudo chown nobody:nogroup /shares/anonymous/
    Step 4 » Now define values in samba configuration to share /shares/anonymous/folder. /etc/samba/smb.conf is the main configurion file for samba .
    Take a backup before editing that file .
    krizna@leela:~$ sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.orgnow add the below code at the end of the file to enable share.
    krizna@leela:~$ sudo vim /etc/samba/smb.conf

    1
    2
    3
    4
    5
    6
    7
    8
    9
    [Anonymous]
           comment = Anonymous share access
           path = /shares/anonymous
           browsable = yes
           writable = yes
           guest ok = yes
           read only = no
           force user = nobody
           force group = nogroup

    Step 5 » Now restart smbd service .
    krizna@leela:~$ sudo service smbd restart
    After restarting service . Try to access share from windows client (Goto -> RUN ->\serverIP ) . you could access anonymous share folder without username and password, try to create or copy files to that folder.

    Creating secured share

    Secured shares can be accessed using username and password .Here for example, I’m going to create share project1.
    Step 6 » Create a folder for share .
    krizna@leela:~$ sudo mkdir -p /shares/project1
    Step 7 » Create a new group smbproj1,so that Users added to this group can access project1 share.
    krizna@leela:~$ sudo addgroup smbproj1
    Step 8 » Modify ownership and permission for the folder.
    krizna@leela:~$ sudo chown root:smbproj1 /shares/project1/
    krizna@leela:~$ sudo chmod 770 /shares/project1/

    Step 9 » Now define values in the configuration file .
    krizna@leela:~$ sudo vim /etc/samba/smb.conf

    1
    2
    3
    4
    5
    6
    7
    [Project1]
             comment = Project1 Share
             path = /shares/project1
             valid users = @smbproj1
             guest ok = no
             writable = yes
             browsable = yes

    Step 10 » Now restart smbd service .
    krizna@leela:~$ sudo service smbd restartAfter restarting service, you could see Project1 share . Additional secured shares can be created in the same way.
    setup file server on ubuntu 14.04

    User creation

    Add new user john for accessing project1 share
    Step 11 » Create a user john .
    krizna@leela:~$ sudo useradd john -s /usr/sbin/nologin -G smbproj1-s /usr/sbin/nologin : Restricting shell access
    -G smbproj1 : Added to smbproj1 group
    Step 12 » Create samba password for user john
    krizna@leela:~$ sudo smbpasswd -a john
    Now user john can access Project1 share. Additional users can be added in the same way.
    For existing users use usermod command to add user in smbproj1 group and create samba password using smbpasswd.
    krizna@leela:~$ sudo usermod mike -G smbproj1
    For accessing multiple shares. Example: dave has access to multiple project groups like smbproj1 and smbproj2.
    krizna@leela:~$ sudo usermod dave -G smbproj1,smbproj2
    For troubleshooting, Use testparm command
    For more info Samba file server guide

     

    in Tech Blog
    Setup Ruby 2.3 on Ubuntu 14.04 Trusty Tahr

    Ontworpen voor bedrijven

    We zijn een team van gepassioneerde mensen met als doel levens te verbeteren met vernieuwende producten. We ontwikkelen geweldige oplossingen voor al je zakelijke uitdagingen. Onze producten zijn ontworpen voor kleine tot middelgrote bedrijven die hun prestaties willen optimaliseren.

    Neem contact op

    Plantexel
    Pedernera
    Salta Capital 
    Argentina

    • +31 653-919-302
    • [email protected]
    Volg ons
    Copyright © Plantexel
    Nederlands | English (US) | Español (AR)