Samba is a free software re-implementation of the SMB networking protocol, and was originally developed by Andrew Tridgell. Samba provides file and print services for various Microsoft Windows clients and can integrate with a Microsoft Windows Server domain, either as a Domain Controller or as a domain member.
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Samba server Pts report pdf by Rohit malav
1. A Report on
“samba servermessage block”
Submitted
In partial fulfillment
Of requirement for
Degree of Bachelor of Technology
In Department of computer Science & Engineering
2019
Submitted To: Submitted By:
Ms.Lavisha Sahu Name:- Rohit malav
Assistant Professor
2. Department of Computer Engineering & Information Technology
Suresh Gyan Vihar University
Mahal, Jagatpura, Jaipur-302017
Certificate
This certifies that the dissertation entitled
“samba server message block”
Is Submitted by
Rohit malav
B.TECH(CSE) in the year 2019 in partial fulfillment of
Degree in Bachelor of Technology in Computer Science & Engineering
Suresh Gyan Vihar University, Jaipur
Ms.Lavisha Sahu Date:
Assistant Professor Place:
3. CANDIDATES’S DECLARATION
I hereby declare that the work, which is being presented in the dissertation, entitled that is “samba server
message block ” in partial fulfillment for the award of Degree of “Bachelor of Technology” in Department
of Computer Science & Engineering with Specialization in Computer Science & Engineering, and
submitted to the Department of Computer Science & Engineering, Suresh Gyan Vihar University is a
record of my own investigation carried under the Guidance of Ms.Lavisha Sahu, Assistant Professor of
Department, Computer Science, Suresh Gyan Vihar University, India.
I have not submitted the matter presented in this Dissertation anywhere for the award of any other
degree.
Rohit malav
Computer Science and Information Technology Department
4. ACKNOWLEDGEMENT
I would like to express my sincere appreciation to this Computer graphics project co-ordinate
Ms.Lavisha Sahu who invented the platform for the ordinary student to educate themselves about
the Computer based application.
My sincerest gratitude goes to Ms.Lavisha Sahu Assistant professor of Department, Computer
Science & Information Technology and who guided, with her attention, expertise and knowledge
throughout the process of this dissertation.I thank her for her valuable guidance, her commitment
timely advice and constant support at each & every step in completion of my study. Without her
proper guidance I wouldn’t get any idea about computer graphics Program.
With her effort and trust I came to know about how much this program is necessary for any B.Tech
student.I express my sincere thanks to Mr. Manish Sharma, Head of Department (HOD),
Computer Science & Information Technology, Suresh Gyan Vihar University, Jaipur for his
encouragement.
Rohit malav
Computer Science and Information Technology Department
5. CERTIFICATE
This is to certify that Project Report entitled “samba servermessage block” which is submitted by Rohit
malav (B.TECH 7TH semester) in partial fulfillment of the requirement for the award B.TECH degree in
department of Computer Science is record of the candidate own work carried out by her under my
supervision. The matter embodied in this project report is original and has not been submitted for the
award of any other degree.
Signature:
Name of Supervisor: Ms.Lavisha Sahu
Designation: Assistant Professor
Date:
6. DECLARATION
I hereby declare that the Lab Project Report, enlisted “samba server message block” has been prepared
as the part for the completion of the degree of Bachelor of Technology from Gyan Vihar school of
Engineering & Technology and it is based on the original work and will be used only for academic
purpose.
It will not be protected in any condition as a source of Information to an Industry
Signature: Signature:
Ms.Lavisha Sahu Rohit malav
8. Table of Contents
1. CHAPTER - 1 7
1.1 ABSTRACT OF THE PROJECT 7
CHAPTER - 2 9
2. REQUIREMENT ANALYSIS
2.1 Platform and Operating Systems
2.2 Software Requirement
9
CHAPTER - 3 10
3. ADVANTAGES & DISADVANTAGES OF SAMBA
3.1 Advantages of samba
3.2 Disadvantages of samba
10
CHAPTER – 4 11
4. PROCEDURE FOR SAMBA
4.1 Machine and Network Overview
4.2 Steps for Server Side
4.2 Steps for Client Side
11
CHAPTER - 5 12
5 SERVER INTRODUCTION 12
5.1 WHY SERVER ? 13
CHAPTER - 6 14
6. THE MOTIVATION 14
CHAPTER - 7 15
7. EXPERIENCE AND KNOWLEDGE ACQUIRED 15
9. 7.1 KNOWLEDGE ON BASESAS 15
7.2 KNOWLEDGE ON SAMBA ENTERPRISE GUIDE (EG) 16
7.3 KNOWLEDGE ON SAMBA VISUAL ANALYTICS (VIYA) 17
7.4 KNOWLEDGE ON SAMBA SENTIMENTAL ANALYSIS 18
CHAPTER - 8 20
8. INTRODUCTION TO THE PROJECT 20
CHAPTER - 9 21
9. IMPLEMENTATION AND RESULT 21
9.1 PROJECT 1 (TEXT AND SENTIMENTAL ANALYSIS ON E-
NEWS)
21
9.2 PROJECT 2 ( CREATING DASHBOARD ON SCHOOL DATA ) 24
CHAPTER - 10 30
10. APPENDICES 30
10.1 CODE FOR MANIPULATION OF DATA IN SAS EG 30
CHAPTER - 11 34
11. CONCLUSION AND SELF-EVALUATION 34
11.1 CONCLUSION 34
11.1.1 COMPETENCY LEVEL : BEFORE 34
11.1.2 COMPETENCY LEVEL : AFTER 34
10. Abstract
A samba, which stands for Internet Small Computer System Interface, works on top of the Transport
Control Protocol (TCP) and allows the smb command to be sent end-to-end over local-area networks
(LANs), wide-area networks (WANs) or the Internet. IBM developed samba as a proof of concept and
presented the first draft of the samba standard to the Internet Engineering.
samba is a block-based set of commands that connects computing devices to networked storage and
file transfer, including spinning up storage media and data reads/writes.
Samba is reliable software that runs on reliable Unix operating systems, resulting in fewer problems and
a low cost of maintenance. Samba also offers better performance under heavy loads, outperforming
Windows 2000 Server by a factor of 2 to 1 on identical PC hardware, according to published third-party
benchmarks.
11. Requirement Analysis
Platform Requirement : Linux
Supportive Operating Systems :
The supported Operating Systems for client include:
• Any Linux Distro: -
Any Linux distro would work as this project is based on open source samba. So installation
would not be an issue as we will be using Linux to complete this project.
12. Software Requirement :
Server Side Software Requirement: -
The first step is the installation of the necessary packages to allow the Debian system to serve out samba
targets. This software package is known as Target Framework (TGT).
Client Side Software Requirement: -
For the client side we have to install, package “open- samba”.
13. Advantages of samba
Free and open-source
Portable across multiple platforms
Allows for easier networking of Windows workstations to computers running other platforms
SMB is still developing, so maintaining compatibility with Microsoft's implementation is a
constant battle
Threat of legal action against commercial users of Samba from Microsoft
Free and open source
Portable across multiple platforms Allows
for easier networking of Windows workstations to computers running other platforms.
samba offers much simpler network storage solutions.
Utilizing samba sharing Ethernet network components, organizations can significantly simplify
their network storage environments
14. Disadvantagesofsamba server
Platform choice is probably the big criteria. You get access to a lot more file systems than on
Windows. You also have access to a more exhaustive set of tunables, should you be interested in
going that route. Some people also prefer the Linux firewall to the Windows one.
Smb is still developing.
Maintaining compatibility with Microsoft’s implementation is a constant battle.
Threat of legal action against commercial users of Samba from Microsoft.
Samba operates on servermessage protocol (normally) and hence there is a chance that it might
be exposed to hackers who are more familiar with the widely used IP sharing Networks.
15. PROCEDURE:-
MACHINES: -
Debian iSCSI Target: 192.168.56.101/24
Storage: Contains two extra hard drives to be used as the
storage in the iSCSI setup
Debian iSCSI Initiator: 192.168.56.102/24
SAMBA SERVER SETUP:-
16. STEPS for SERVER SIDE : -
In the samba world, the target is considered the host that contains the storage devices to be used by the
initiator.
In this article the server with the IP of 192.168.56.101 is being used as the target. All
configurations will be done on that host for this section.
The first step is the installation of the necessary packages to allow the Debian system to serve out
SAMBA targets. This software package is known as Target Framework (TGT).
The other item that is being used for this guide is the Logical Volume Management (LVM) tools as
Logical Volumes (LVs) will be used as the storage backing for the iSCSI target. Both packages can be
installed with the following commands.
# apt-get update
# apt-get install tgt lvm2
Once the packages are installed, LVM will be used to prepare the hard disks on the target for use as an
smb LUN. The first command is used to prepare the disks for inclusion in a LVM setup. Be sure to modify
the command as needed for different scenarios!
# lsblk (Only used to confirm disks to be used in the LVM
setup)
# pvcreate /dev/sd{b,c}
Once the disks have been prepared with the above ‘pvcreate‘ command, it is time to create a volume
group out of these particular disks. The volume group is required in order to create the Logical
Volumes that will act as the samba sharing later.
To create a volume group, the ‘vgcreate‘ command is needed.
# vgcreate tecmint_samba /dev/sd{b,c}
# vgs (Only needed to confirm the creation of the volume
group)
17. The capacity of this volume group is only 9.99GB. While this is a particularly small volume group,
the process would be the same for disks of larger capacity!
The next step is the creation of the logical volume that will act as the disk to the samba client (initiator). For
this example the entirety of the the volume group will be used but isn’t necessary.
Once the logical volume has been created, it’s time to create the actual LUN (Logical Unit
Number). The LUN will be the storage device that the initiator will connect to and use later.
Creating a LUN is very simple and requires only a few steps. The first step will be the creation of
the configuration file. This file will reside in the ‘/etc/tgt/conf.d‘ directory and for this article it
will be called ‘TecMint_samba.conf‘.
To create this file use a text editor.
# nano /etc/tgt/conf.d/TecMint_samba.conf
Within this file, all the necessary configuration information for this LUN will be configured. There
are a lot of options that can be placed in this file but for now a basic LUN with mutual Challenge
Handshake Authentication Protocol (CHAP) will be configured.
The LUN’s definition will exist between two ‘target‘ statements. For more parameters that can go in
the target statement, review the manual page for the ‘targets.conf‘ file by issuing ‘man 5 targets.conf‘.
<target iqn.2019-10.rohit.com:lun1>
# Provided device as an samba target backing-store
/dev/mapper/tecmint_samba-tecmint_lun1 initiator-address
192.168.56.102
incominguser tecmint-samba-user password
outgoinguser debian-samba-target secretpass
</target>
18. There’s a lot going on above. A quick explanation may be helpful to most.
▪ The first line begins the particular samba LUN configuration. In this case
the LUN labeled ‘iqn.2019-10.rohit.com:lun1‘. The ‘iqn‘ part indicates that this will be an samba
qualified name. The ‘2019-10‘ is an arbitrarily chosen date combination. ‘samba.com‘ is the
domain that this particular LUN belongs. Finally, the ‘lun1‘ is used as the name for this particular
target.
▪ The second line above illustrates a comment. Comments can exist in the target
configuration files and must be prefaced with a ‘#‘ symbol.
▪ The third line is where the actual storage space that will be used by the initiator exists. In this
case the storage backing will be the logical volume that was created earlier in the guide.
▪ The fourth line is the IP address that is expected from the initiator. While this isn’t a required
configuration item, it can help increase security.
▪ The fifth line is the incoming username/password. Much like the initiator address above, this
parameter isn’t required either but can help to secure the LUN. Since this guide is also covering
samba mutual CHAP, this parameter is required. This line indicates the username and password
that the target will expect from the initiator in order to connect to this LUN.
▪ The sixth line is the username/password that the target will provide to the initiator to allow
for mutual CHAP authentication to take place. Normally this parameter is not required but
this article is covering mutual CHAP authentication so this parameter is required.
▪ The final line is the closing statement for the target definition. Pay attention to the closing slash in
front of the keyword target!
Once the configuration file has been created, the tgt service should be restarted so tgt is aware of the new
targets and the associated configuration.
This can be done with one of the following commands and is dependent on the init system in use.
# service tgt restart (For sysv init systems)
# systemctl restart tgt (For systemd init systems)
Once tgt has been restarted, it is important to check to ensure that the samba target is being made available
according to the configuration file created.
This can be accomplished with the ‘tgtadm‘ command.
# tgtadm --mode target --op show (This will show all
targets)
19. This concludes the configuration of the target. The next section will work through the
configuration of the initiator.
STEPS for CLIENT SIDE : -
The first step in this process for this Debian initiator is the installation of the proper packages for
samba.
# apt-get update
# apt-get install open-samba
Once apt has finished the configuration of the open-iscsi packages, the samba
initiator configuration can begin. The first step will be to communicate with the target to get the initial
configuration information for the target prepared.
# sambaadm -m discovery -t st -p 192.168.56.101
When this command runs, it will respond back with the name of the lun configured earlier for this
particular host.
Now the file created for this node will need to have the CHAP information configured in order for this
samba target to actually be accessible by the initiator.
Technically this information could be setup for the entire system as a whole but in the event that a host
connects to different LUNs with different credentials, placing those credentials in the specific node
configuration file can mitigate any issues.
The node configuration file will exist in the directory ‘/etc/iscsi/nodes/‘ and will have a directory per
LUN available. In the case of this article (note that paths will change if names/IP addresses are changed).
# /etc/samba/nodes/iqn.201-
10.rohit.com:lun1/192.168.56.101,3260,1/default
20. To work with this file, any text editor can be used.
# nano /etc/samba/nodes/iqn.2019-
10.rohit.com:lun1/192.168.56.101,3260,1/default
Within this file there will be several already configured options for the respective target that were
determine during the ‘samba adm‘ command run earlier.
Since this particular Debian target/initiator setup is using mutual CHAP, some more options need to be
changed and added to this file and then a login to the samba target performed. The changes to this file are:
node.session.auth.authmethod = CHAP
#Enable CHAP Authentication
node.session.auth.username = tecmint-samba-user
#Target to Initiator authentication
node.session.auth.password = password
#Target to Initiator authentication
node.session.auth.username_in = debian-samba-target
#Initiator to Target authentication
node.session.auth.password_in = secretpass
#Initiator to Target authentication
The above options will allow this target to authenticate to the initiator as well as allow the
initiator to authenticate to the target.
There is another option in this particular file that may need to be changed depending on the
administrator’s preferences and that is the ‘node.startup‘ parameter.
If following this guide, the ‘node.startup‘ option will be set to ‘manual‘ at this point. This may not be
desired. If the administrator wishes to have the samba target connected when the system starts up,
change ‘manual‘ to ‘automatic‘.
tomatic
21. Once the above changes have been made, save the file and exit. At this point the open-samba initiator
service needs to be restarted in order to read these new changes and connect to the samba target.
This can be accomplished with one of the following commands depending on the init system in use.
# service open-samba restart (For sysv init systems)
# systemctl restart open-samba (For systemd init systems)
To further confirm that the samba target is indeed available to the initiator, we can check the system for
extra disk drives that are available using the ‘lsblk‘ command and checking the output for extra drives.
# lsblk
The other command that can be used on the initiator to confirm a connection to the target is ‘samba
adm‘ as such:
# samba adm -m session
The final place to confirm a connection would be on the target itself using the ‘tgtadm‘ command to list
any samba connections.
# tgtadm --mode conn --op show --tid 1
From this point, the newly attached samba device can be used similar to any normally attached disk!
Partitioning, filesystem creation, mounting, and/or persistent mounting can all able be handled
normally.
22. SCREENSHOTS BY STEP TO STEP
STEP 1
Go to the Start menu and search for notepad. Now right click on Notepad icon and click on Run as
administrator.
STEP 2
Now press <Ctrl> + o to go to File > Open… and select the
file C:WindowsSystem32Driversetchosts
23. STEP 4
Now add the above line to the end of the file. Now press <Ctrl> + s or go to File > Save to save the file.
STEP 5
Accessing Samba Shares from Windows Client:
From windows, just open the File Explorer and type in HOSTNAMESHARENAME in your
location as marked in the screenshot below. Once you’re done, press <Enter>.
24. STEP 6
Now type in your Samba USERNAME and PASSWORD and click on OK.
STEP 7
You should be logged in to your share as you can see.
25. CONCLUSION
This project includes a large variety of technical domains such as Networking, Open Source
Technology, File Systems and many more. With this project we learned how to use samba for sharing
block of storage over the network. This essentially is very important.
Using samba server, we can create centralized storage solutions which could be really helpful in current
scenario of technological evolution. Creating centralized storage solution is more cost friendly and
secure way as we can see that there are many threats in IT companies which could be really harmful.
As we noticed samba uses TCP/IP for transferring the block of storage across the network which
allows it to transfer data without data loss as TCP/IP ensures that no packet is lost during the
transmission. Also, it uses IP for authentication of the clients to which the block of storage is to be
shared which makes it more secure and reliable.
Now a days, samba server is very important and hence it is necessary for every client who are not
capable to attach a physical hard disk or storage device with system because they want to less
everything and request to server to provide remotely to TCP/IP internet environment.
As we are using Linux distros as our operating system, we are cutting down the cost to very large extent
and this project itself is very useful in cutting down the costs for any industry which require a large
number of computer systems.