Transact

⌘K
  1. Home
  2. Transact
  3. Install and Upgrade
  4. Additional Resources
  5. Linux
  6. Samba Share
  7. Create Samba Share on Ubuntu 13.10

Create Samba Share on Ubuntu 13.10

  1. Make sure internet is available on the system.
  2. Make sure that user has proper permission to install software on the system.

To install software on Ubuntu a user needs to have Super user permission thus in order to install Samba user must use sudo to install it.

sudo apt-get update
sudo apt-get install samba

Untitled13

Figure: Samba installation on ubuntu

 

  1. Add a user to samba and assign password to that user. Next step demonstrates method to add user to samba and assign samba password for that user. This process needs sudo permissions.

 

sudo smbpasswd -a turbo

(-a is for adding user to samba and turbo is username to be added to samba)

Untitled14

Figure: Adding user to samba and assigning samba password for the user.

smbpasswd adds a user to samba and assigns samba password for the user. User will see error message if user does not exists on the Linux system.

Untitled15

Figure: Error adding user to samba as user does not exists on Linux machine.

  1. Testing samba demons smbd and nmbd. This requires sudo permission.

sudo service smbd restart
sudo service nmbd restart

Untitled16

Figure: Restarting smbd and nmbd

Samba Configuration

Adding a folder to network share

Samba shares can be configured through /etc/samba/smb.conf file which holds configuration details for samba server.

  1. Open smb.conf present inside /etc/samba/smb.conf using VI editor. Open file with sudo permissions as user may need to edit file.

sudo vi /etc/samba/smb.conf

 

  1. E.g. User wants to make SharedFolders present at /home/turbo/Ephesoft/SharedFolders as shareable on samba share. User can do this by adding/appending following line to the end of smb.conf file. But before this user will need to give read, write, execute permission to everyone on the sharedfolders by executing following command (by default Ephesoft installer assigns rwx permission to everyone on SharedFolders):

sudo chmod –R 777 /home/turbo/Ephesoft/SharedFolders

Append following lines to end of smb.conf.

 

[ephesoft]

comment=ephesoft
path=/home/turbo/Ephesoft/SharedFolders
browseable=yes
writable=yes
create mode=0777
directory mode=0777
share mode=yes
guest ok=yes
valid users=turbo

 

Untitled17

Figure: Share created with name ephesoft which point to /home/turbo/Ephesoft/SharedFolders on machine.

 

Details of parameters added to smb.conf

 

  1. Comment: comment for the shared folder.
  2. path : specifies the path of shared folder.
  3. browseable : allows to browse the files from file system.
  4. writeable : makes the shared folder writeable
  5. create mode : create files with group=rw permissions.
  6. directory mode : create dirs. with group=rw permissions.
  7. guest ok:allows guest access
  8. valid users : specifies list of valid users who can access the shared folder (users must be part of user-group assigned to the shared folder).
  9. Assign multiple users to list of valid users as one credential can be used by single machine at a time.

 

User will need to create the share with write, creation, readable and browseable permissions etc. The statements mentioned above make sure of the same.

 

  1. Save smb.conf file and restart smbd and nmbd demons by executing following commands.

sudo service smbd restart
sudo service nmbd restart

Untitled18

Figure: restarting samba smbd/nmbd demons

 

Now user can access this shared folder.

Untitled19

Figure: sharedfolders accessible on network

 

Accessing SharedFolders on different Ephesoft nodes in multi-cluster setup

 

In order to setup SharedFolders on different Ephesoft nodes in multi-cluster setup user will need to mount the network share on a folder on every Ephesoft  Linux node as Linux doesn’t unserstand network paths as windows does i.e. on windows network share can be directly access using \ip –addr but on Linux it can be done using samba protocol which works in different manner.

 

Note: Installer will create a empty folder on same location on every Ephesoft node other than the node on which actual shared folder lies i.e. path of empty folder will be same as path of actual shared folder on machine where actual shared folders lies e.g. In above configuration where SharedFolder has been added to samba share the actual folder lies at /home/turbo/Ephesoft/SharedFolders so empty folder will be created at same path on each machine using Ephesoft installer.

 

Now user will have to mount the network sharedfolders on each empty folders created by installer on each Ephesoft node.

 

Mounting network share on empty folders created by installer

User can mount the samba share over an empty folder by executing following command.

sudo mount -t cifs -o user=turbo,password=Passw0rd //192.168.108.21/ephesoft /home/turbo/Ephesoft/SharedFolders

Here password is the password of smbuser for which smbpasswd was set.

Untitled20

Figure: mounting share on empty folder /home/turbo/Ephesoft/SharedFolders

Untitled21

Figure: network shared folder mounted on empty folder on another Ephesoft node.

User will be able to access the mounted shared folder locally by accessing /home/turbo/Ephesoft/SharedFolders as this folder is acting as mount point for network share. User will be able to create/modify files/folders locally on this path and changes will be reflected on the network share and on all the machines where this network share has been mounted.

Untitled22

Figure: User able to access the SharedFolder locally on mounted folder.

Untitled23

Figure: User creating folder on the mounted folder and these changes will be reflected on all the mount points and network share.

Untitled24

Figure: Changes of folder creation reflected on the network share.

Note*: Ephesoft META-INF properties file will contain the path of locally mounted folders and not the network path as Linux doesn’t understand the network share like windows do. Linux makes use of smb protocol to access the share folder. Hence user will have to mount network shared folders locally on their system such that Ephesoft is able to see data on same path on every system.