[Linux] Build File Server with Samba

Samba_LogoIn computing, a file server is a computer attached to a network that has the primary purpose of providing a location for shared disk access, i.e. shared storage of computer files (such as documents, sound files, photographs, movies, images, databases, etc.) that can be accessed by the workstations that are attached to the same computer network. The term server highlights the role of the machine in the client–server scheme, where the clients are the workstations using the storage. A file server is not intended to perform computational tasks, and does not run programs on behalf of its clients. It is designed primarily to enable the storage and retrieval of data while the computation is carried out by the workstations.(Wikipedia)

Today, i will show you how to create simple file server in linux using Samba. Here we go :

  1. Download Samba File Server from terminal : sudo apt-get install samba
  2. After installation process done, we will modify the config file. You can create backup of the file with : sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak. That will create file named smb.conf.bak
  3. Edit the smb.conf : sudo nano /etc/samba/smb.conf.
  4. In this tutorial, i will create file server with login authority, so only user that knows the user and password for login can use the file server. Scroll down to the end, and paste this code :
    path = /samba/secured
    valid users = @secured
    guest ok = no
    writable = yes
    browsable = yes
  5. Now, save the changes (Ctrl X, Ctrl S) and restart samba
  6. Create folder with path /samba/secured : sudo mkdir -p /samba/secured (you can type any name as long as match with the one in smb.conf)
  7. Change permission to the folder so everyone can access/modify it : sudo chmod -R 777 /samba/secured
  8. Create group, for example secured : sudo addgroup secured
  9. Create a new user and add into securedgroup, for example the username is dummy : sudo useradd dummy, then type again : sudo usermod -a -G secured dummy
  10. To give user a password when try to login into file server, use : sudo smbpasswd -a dummy. Then type the password that will be used when try to access the file server
  11. The last, restart samba services :
    sudo restart smbd
    sudo restart nmbd
  12. To access the file server from Windows, make sure that computer with samba services is on, both connected in the same networks,  and type \\server_ip_address from Start Menu – Run, for example : \\

sources :




That’s it. Hope it helps 🙂




Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s