WHAT IS SAMBA SERVER AND HOW TO CONFIGURE IN LINUX

Samba servers, your Linux and Windows systems can share directories and printers. This is most use full situation where your clients are window native and you want to use the linux security features.Samba uses the TCP/IP protocol that is installed on the host server. When correctly configured, it allows that host to interact with a Microsoft Windows client

samba server

Follow these steps to configure samba server:

  • First we have to install package which is required for samba server.
[root@localhost ~]# yum install samba*

Loaded plugins: rhnplugin, security
Repository 'a' is missing name in configuration, using id
This system is not registered with RHN.
RHN support will be disabled.
a                                                                                      | 1.3 kB     00:00
Setting up Install Process
Package samba-common-3.0.33-3.14.el5.i386 already installed and latest version
Package samba-client-3.0.33-3.14.el5.i386 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package samba.i386 0:3.0.33-3.14.el5 set to be updated
--> Processing Dependency: perl(Convert::ASN1) for package: samba
---> Package samba-swat.i386 0:3.0.33-3.14.el5 set to be updated
--> Running transaction check
---> Package perl-Convert-ASN1.noarch 0:0.20-1.1 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
==============================================================================================================
 Package                          Arch                  Version                        Repository        Size
==============================================================================================================
Installing:
 samba                            i386                  3.0.33-3.14.el5                a                 16 M
 samba-swat                       i386                  3.0.33-3.14.el5                a                8.2 M
Installing for dependencies:
 perl-Convert-ASN1                noarch                0.20-1.1                       a                 41 k
Transaction Summary
==============================================================================================================
Install      3 Package(s)
Update       0 Package(s)
Remove       0 Package(s)
Total download size: 24 M
Is this ok [y/N]: y
  • It will calculate the file size and ask you whether you wanna install it or not. Type y and hit ENTER.
Downloading Packages:
--------------------------------------------------------------------------------------------------------------
Total                                                                         246 MB/s |  24 MB     00:00
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : perl-Convert-ASN1                                                                      1/3
  Installing     : samba                                                                                  2/3
  Installing     : samba-swat                                                                             3/3
Installed:
  samba.i386 0:3.0.33-3.14.el5                        samba-swat.i386 0:3.0.33-3.14.el5
Dependency Installed:
  perl-Convert-ASN1.noarch 0:0.20-1.1
Complete!
  • Now create a folder which will be used by Samba server to share  it with client.
[root@localhost ~]# mkdir Deepit
  • Also create user for client access . Do remember to give password.
[root@localhost ~]# useradd deepit
[root@localhost ~]# passwd deepit
Changing password for user deepit.
New UNIX password:
BAD PASSWORD: it is WAY too short
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
  • Now go that folder and create some files for testing whether it will show in client machine or not.
[root@localhost ~]# cd Deepit
[root@localhost Deepit]# touch {a..z}.txt
  • Check whether itsbeen created or not by ls command.
[root@localhost Deepit]# ls
a.txt  c.txt  e.txt  g.txt  i.txt  k.txt  m.txt  o.txt  q.txt  s.txt  u.txt  w.txt  y.txt
b.txt  d.txt  f.txt  h.txt  j.txt  l.txt  n.txt  p.txt  r.txt  t.txt  v.txt  x.txt  z.txt
  • Give permission to this folder to read ,write and execute by chmod command.
[root@localhost ~]# chmod 7 Deepit
  • Now give password to user (deepit) who will be accessing through SAMBA Server.
  • I’M giving password – 123 for user deepit
[root@localhost ~]# smbpasswd -a deepit
New SMB password:
Retype new SMB password:

tdbsam_open: Converting version 0 database to version 3.
account_policy_get: tdb_fetch_uint32 failed for field 1 (min password length), returning 0
account_policy_get: tdb_fetch_uint32 failed for field 2 (password history), returning 0
account_policy_get: tdb_fetch_uint32 failed for field 3 (user must logon to change password), returning 0
account_policy_get: tdb_fetch_uint32 failed for field 4 (maximum password age), returning 0
account_policy_get: tdb_fetch_uint32 failed for field 5 (minimum password age), returning 0
account_policy_get: tdb_fetch_uint32 failed for field 6 (lockout duration), returning 0
account_policy_get: tdb_fetch_uint32 failed for field 7 (reset count minutes), returning 0
account_policy_get: tdb_fetch_uint32 failed for field 8 (bad lockout attempt), returning 0
account_policy_get: tdb_fetch_uint32 failed for field 9 (disconnect time), returning 0
account_policy_get: tdb_fetch_uint32 failed for field 10 (refuse machine password change), returning 0
Added user deepit.
  • Do remember to diasble your firewall and security enhance settings.
[root@localhost ~]# iptables -F
[root@localhost ~]# setenforce 0
  • Now start the samba server service.
[root@localhost ~]# service smb restart

Shutting down SMB services:                                [FAILED]
Shutting down NMB services:                                [FAILED]
Starting SMB services:                                     [  OK  ]
Starting NMB services:                                     [  OK  ]

NOW COMES THE CLIENT ROLE

  • Enter the ip address of server machine in run dialog box.

samba server

  • Next it will ask you to give username and password .

samba server

  • Give username and password we have created earlier .
  • Username deepit and password 123.

samba server

  • Now client is connected to server machine through Samba server.And its showing the folder admin have created to share . Open the folder and you will find all the files admin have created earlier.

samba server

  • If you wanna stop Samba server .
root@localhost ~]# service smb stop
Shutting down SMB services:                                [  OK  ]
Shutting down NMB services:                                [  OK  ]
  • Check whether its been stopped or not.
[root@localhost ~]# service smb status
smbd is stopped
nmbd is stopped
[root@localhost deepit]# python2.4 -m SimpleHTTPServer 8822

Serving HTTP on 0.0.0.0 port 8822 ...
  • Now open your browser and type ip address with port number. And you will find all the content in that folder .

python server

  • And in server machine admin can see by ip address who all is connected to python server.
192.168.0.103 - - [28/Dec/2016 00:16:21] "GET / HTTP/1.1" 200 -
192.168.0.103 - - [28/Dec/2016 00:16:23] code 404, message File not found
192.168.0.103 - - [28/Dec/2016 00:16:25] "GET /favicon.ico HTTP/1.1" 404 -
192.168.0.103 - - [28/Dec/2016 00:16:28] "GET /windown%208%2610creak/ HTTP/1.1" 200 -
192.168.0.103 - - [28/Dec/2016 00:16:30] code 404, message File not found
192.168.0.103 - - [28/Dec/2016 00:16:32] "GET /favicon.ico HTTP/1.1" 404 -
192.168.0.103 - - [28/Dec/2016 00:16:34] code 404, message File not found
192.168.0.103 - - [28/Dec/2016 00:16:36] "GET /favicon.ico HTTP/1.1" 404 -
192.168.0.103 - - [28/Dec/2016 00:16:38] code 404, message File not found
192.168.0.103 - - [28/Dec/2016 00:16:40] "GET /favicon.ico HTTP/1.1" 404 -
192.168.0.103 - - [28/Dec/2016 00:16:41] "GET /windown%208%2610creak/ HTTP/1.1" 200 -
192.168.0.103 - - [28/Dec/2016 00:16:43] code 404, message File not found
192.168.0.103 - - [28/Dec/2016 00:16:45] "GET /favicon.ico HTTP/1.1" 404 -
192.168.0.103 - - [28/Dec/2016 00:16:46] code 404, message File not found
192.168.0.103 - - [28/Dec/2016 00:16:48] "GET /favicon.ico HTTP/1.1" 404 -
192.168.0.103 - - [28/Dec/2016 00:16:49] "GET /windown%208%2610creak/Windows%208.1%20crack/ HTTP/1.1" 200 -
Traceback (most recent call last):
  File "/usr/lib/python2.4/SimpleHTTPServer.py", line 204, in ?
    test()
  File "/usr/lib/python2.4/SimpleHTTPServer.py", line 200, in test
    BaseHTTPServer.test(HandlerClass, ServerClass)
  File "/usr/lib/python2.4/BaseHTTPServer.py", line 573, in test
    httpd.serve_forever()
  File "/usr/lib/python2.4/SocketServer.py", line 201, in serve_forever
    self.handle_request()
  File "/usr/lib/python2.4/SocketServer.py", line 217, in handle_request
    request, client_address = self.get_request()
  File "/usr/lib/python2.4/SocketServer.py", line 373, in get_request
    return self.socket.accept()
  File "/usr/lib/python2.4/socket.py", line 169, in accept
    sock, addr = self._sock.accept()
KeyboardInterrupt

So this how you can create Samba server .And little trick to use python server too.

WHAT IS NFS SERVER AND HOW TO CONFIGURE NFS SERVER IN LINUX.

WHAT IS TELNET AND HOW TO CONFIGURE TELNET IN LINUX AS SERVER AND WINDOWS OR ANDROID AS CLIENT.

HOW TO MAKE SECURE PHONE CALLS (ANDROID OR IOS)

 

13 thoughts on “WHAT IS SAMBA SERVER AND HOW TO CONFIGURE IN LINUX

  1. Wow, excellent weblog structure! How long have you been blogging for?
    you make blogging easy. The overall look of
    your site is superb, neatly as the content material!

    Like

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 )

Google+ photo

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

Connecting to %s