Linux Shared File System




How to make File Sharing with Samba in Ubuntu – in this article I will be doing sharing files from linux Ubuntu to another computer and connected to the internet during installation. (if it is already done in to isntall can be used in local network or a public network) and can be used by the operating system what are the example of Windows XP, Windows 7, Windows 8, Windows 10 or Linux, etc.

Samba is a file sharing protocol. and not just file sharing, but can also be used for printers, made to be able to share files and printers with a computer that uses a windows operating system, not just windows, Unix operating system and its derivatives such as linux Debian, CentOS, Linux, bsd, and many more can use the samba Protocol. either follow the way below.

In fact many are already discussing how to make File Sharing with Samba in Ubuntu, how to make File Sharing with Samba in Debian and others but no problem.



How to make File Sharing with Samba on Ubuntu: (Tested Ubuntu Linux at 14)

First step – namely:
1. First Install samba on linux ubuntu at 14 with the following command:
sudo apt-get install samba samba-common system-config-samba python-glade2 gksu

2. after the installation process is complete, the backup used to be the default configuration of samba (for keep-awake if later error at the time of the backup file to make configuration. "smb.conf" with name "smb.conf.bak"
mv /etc/samba/ smb.conf /etc/samba/smb.conf.bak

3. after backup open files using samba Configuration Editor Vim, Nano or Gedit
sudo gedit /etc/samba/smb.conf

4. in this file we will add global configuration for samba, add the following command at the end of the file "smb.conf"
[global]
workgroup = WORKGROUP
server string = Samba Server %v
netbios name = srvr1
security = user
map to guest = bad user
name resolve order = bcast host
dns proxy = no

The above configuration defines how the managed server, the Security Server that will be used to connect and workgroup are assigned to the server.

When you are finished entering configuration above and save the file and then exit.

Making Samba file Sharing with specified user
Samba provides services with User-Mode and Gues-mode (Anony Mode). The difference between these two modes is as follows:
  • User Mode: this is the only mode can allow specific users who can access the files that we are sharing.
  • Guest-Mode (Anony Mode): is a mode that allows all user/user to access all the files that we are sharing.
How to make File Sharing with Samba Using the Samba User: Guest-mode (Anony Mode)
Step – Step as follows:
  • Create a folder that will be sharing, for example I will create a folder with the name of the admin on the way home directory cd/home and then input the following command:
Mkdir -p admin
  • After the directory is created, be sure to change the ownership to anyone (right of access). This allows each person to have access to it. To do that, run the command below.
sudo chmod -R 0755 admin
sudo chown -R nobody:nogroup admin/
  • Turn on the samba share to direktory admin by adding the following command in the file "/etc/samba/smb.conf" (command: "gedit /etc/samba/smb.conf") or by other editors, in the path: ahmad is my user name is admin Directory which I will shared
[sharing]
path = /home/ahmad/admin
browsable = yes
writable = yes
guest ok = yes
read only = no
  • Restart samba Service with the command
sudo service smbd restart

Up to this stage I guess the Guest-for configuration mode is already finished, now try to check your file sharing over the network. good luck.

How to make File Sharing with Samba: Samba User Mode using the User Mode
The next step create a folder sharing with User mode Mode meaning that only certain people can open this folder.

Step – step as follows:
  • First create a folder which we will share with the User mode-mode, for example I will create a folder/directory with the name ahmad in "/home/ahmad/" (Description: ahmad was the name of the user on my laptop)
sudo Mkdir -p ahmad
  • After that, let us create a special user on ubuntu we who we give access rights to be able to access a confidential folder
useradd nurdaim
  • We created the group name to use as the user group that will be able to access a confidential folder, for example here I will make by naman "securedprivat"
sudo addgroup securedprivat
  • Add user nurdaim into group securedprivat
sudo usermod -a -G securedprivat nurdaim
  • Create a password for user nurdaim samba with the command
sudo smbpasswd -a nurdaim
  • Then change the folder permissions for member only secret securedprivat
sudo chown -R nurdaim:securedprivat client
sudo chmod -R 0770 client/
  • Modify the samba configuration file at "/etc/samba/smb.conf", then add the following command
[client]
path = /home/ahmad/client
valid users = @securedprivat
guest ok = no
writable = yes
browsable = yes
  • Save and exit the file "smb.conf" and then restart samba service.
sudo service smbd restart

Until this stage should you've managed to make the samba file sharing with User mode-mode, please check through the network


Next
Previous
Click here for Comments

0 comments: