Install Samba Server on Ubuntu 13.04 12.10 Debian Linux Mint 15 13

Install Samba Server on Ubuntu 13.04 12.10 Debian Linux Mint 15 13

samba logo

Step 1: Install samba on Ubuntu

root@ubuntu:~# apt-get install samba samba-common
Reading package lists… Done
Building dependency tree
Reading state information… Done
samba-common is already the newest version.
The following packages were automatically installed and are no longer required:
apache2-mpm-worker apache2-utils apache2.2-common
Use ‘apt-get autoremove’ to remove them.
Suggested packages:
openbsd-inetd inet-superserver smbldap-tools ldb-tools
The following NEW packages will be installed:
samba tdb-tools
0 upgraded, 2 newly installed, 0 to remove and 240 not upgraded.
Need to get 4,112 kB of archives.
After this operation, 23.0 MB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu/ raring/main samba i386 2:3.6.9-1ubuntu1 [4,089 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu/ raring/main tdb-tools i386 1.2.10-2ubuntu1 [22.6 kB]
Fetched 4,112 kB in 45s (89.5 kB/s)
Preconfiguring packages …
Selecting previously unselected package samba.
(Reading database … 173984 files and directories currently installed.)
Unpacking samba (from …/samba_2%3a3.6.9-1ubuntu1_i386.deb) …
Selecting previously unselected package tdb-tools.
Unpacking tdb-tools (from …/tdb-tools_1.2.10-2ubuntu1_i386.deb) …
Processing triggers for man-db …
Processing triggers for ufw …
Processing triggers for ureadahead …
Setting up samba (2:3.6.9-1ubuntu1) …
Generating /etc/default/samba…
update-alternatives: using /usr/bin/smbstatus.samba3 to provide /usr/bin/smbstatus (smbstatus) in auto mode
smbd start/running, process 9766
nmbd start/running, process 9800
Setting up tdb-tools (1.2.10-2ubuntu1) …
update-alternatives: using /usr/bin/tdbbackup.tdbtools to provide /usr/bin/tdbbackup (tdbbackup) in auto mode
Processing triggers for ufw …
Processing triggers for ureadahead …
root@ubuntu:~#

Step 2: Install system configuraration for samba

root@ubuntu:~# apt-get install python-glade2 system-config-samba
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages were automatically installed and are no longer required:
apache2-mpm-worker apache2-utils apache2.2-common
Use ‘apt-get autoremove’ to remove them.
The following extra packages will be installed:
libglade2-0 libuser1 python-central python-libuser python-support
Suggested packages:
python-gtk2-doc
The following NEW packages will be installed:
libglade2-0 libuser1 python-central python-glade2 python-libuser python-support system-config-samba
0 upgraded, 7 newly installed, 0 to remove and 240 not upgraded.
Need to get 5,649 kB of archives.
After this operation, 5,684 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://us.archive.ubuntu.com/ubuntu/ raring/main libglade2-0 i386 1:2.6.4-1ubuntu2 [52.9 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu/ raring/universe libuser1 i386 1:0.56.9.dfsg.1-1.2ubuntu2 [75.8 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu/ raring/universe python-central all 0.6.17ubuntu2 [41.4 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu/ raring/main python-glade2 i386 2.24.0-3ubuntu1 [9,818 B]
Get:5 http://us.archive.ubuntu.com/ubuntu/ raring/universe python-support all 1.0.15 [26.7 kB]
Get:6 http://us.archive.ubuntu.com/ubuntu/ raring/universe python-libuser i386 1:0.56.9.dfsg.1-1.2ubuntu2 [22.6 kB]
Get:7 http://us.archive.ubuntu.com/ubuntu/ raring/universe system-config-samba all 1.2.63-0ubuntu5 [5,420 kB]
Fetched 5,649 kB in 3min 4s (30.7 kB/s)
Selecting previously unselected package libglade2-0:i386.
(Reading database … 174081 files and directories currently installed.)
Unpacking libglade2-0:i386 (from …/libglade2-0_1%3a2.6.4-1ubuntu2_i386.deb) …
Selecting previously unselected package libuser1.
Unpacking libuser1 (from …/libuser1_1%3a0.56.9.dfsg.1-1.2ubuntu2_i386.deb) …
Selecting previously unselected package python-central.
Unpacking python-central (from …/python-central_0.6.17ubuntu2_all.deb) …
Selecting previously unselected package python-glade2.
Unpacking python-glade2 (from …/python-glade2_2.24.0-3ubuntu1_i386.deb) …
Selecting previously unselected package python-support.
Unpacking python-support (from …/python-support_1.0.15_all.deb) …
Selecting previously unselected package python-libuser.
Unpacking python-libuser (from …/python-libuser_1%3a0.56.9.dfsg.1-1.2ubuntu2_i386.deb) …
Selecting previously unselected package system-config-samba.
Unpacking system-config-samba (from …/system-config-samba_1.2.63-0ubuntu5_all.deb) …
Processing triggers for man-db …
Processing triggers for bamfdaemon …
Rebuilding /usr/share/applications/bamf-2.index…
Processing triggers for desktop-file-utils …
Processing triggers for gnome-menus …
Processing triggers for hicolor-icon-theme …
Setting up libglade2-0:i386 (1:2.6.4-1ubuntu2) …
Setting up libuser1 (1:0.56.9.dfsg.1-1.2ubuntu2) …
Setting up python-central (0.6.17ubuntu2) …
Setting up python-glade2 (2.24.0-3ubuntu1) …
Setting up python-support (1.0.15) …
Setting up python-libuser (1:0.56.9.dfsg.1-1.2ubuntu2) …
Setting up system-config-samba (1.2.63-0ubuntu5) …
Processing triggers for libc-bin …
ldconfig deferred processing now taking place
Processing triggers for python-support …
Processing triggers for python-central …
root@ubuntu:~#

Step 3: Backup and remove old smb configuration

root@ubuntu:/etc/samba# sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
root@ubuntu:/etc/samba# sudo rm /etc/samba/smb.conf

Step 4: Create new smb and  Public folder which we can share for everyone (guest)

root@ubuntu:/etc/samba# nano smb.conf
#======================= Global Settings =====================================
[global]
workgroup = WORKGROUP
server string = IThelpblog Samba Server %v
netbios name = ubuntu13
security = user
map to guest = bad user
dns proxy = no
#============================ Share Definitions ==============================
[PublicShare]
path = /samba/share
browsable =yes
writable = yes
guest ok = yes
read only = no
root@ubuntu:/etc/samba#

Step 5: Restart service

root@ubuntu:/etc/samba# service smbd restart
smbd stop/waiting
smbd start/running, process 10981
root@ubuntu:/etc/samba#

Step 6: Create folder and change permission for share folder

root@ubuntu:/etc/samba# mkdir -p /samba/share
root@ubuntu:/etc/samba# chmod 777 /samba/share

Now we can access PublicShare without password

ubuntu samba

Step 7: Create Kevin folder with User authentication

root@ubuntu:/etc/samba# nano smb.conf
#======================= Global Settings =====================================
[global]
workgroup = WORKGROUP
server string = IThelpblog Samba Server %v
netbios name = ubuntu13
security = user
map to guest = bad user
dns proxy = no
#============================ Share Definitions ==============================
[PublicShare]
path = /samba/share
browsable =yes
writable = yes
guest ok = yes
read only = no
[kevin.ngo.ithelpblog]
path = /samba/kevin
valid users = @itgroup
guest ok = no
writable = yes
browsable = yes

Step 8: Create folder and user authentication

root@ubuntu:/etc/samba# cd /samba
root@ubuntu:/samba# mkdir kevin
root@ubuntu:/samba# addgroup itgroup
Adding group `itgroup’ (GID 1003) …
Done.
root@ubuntu:/samba# adduser kevin itgroup
Adding user `kevin’ to group `itgroup’ …
Adding user kevin to group itgroup
Done.
root@ubuntu:/samba# chown -R kevin.itgroup kevin
root@ubuntu:/samba# chmod -R 0770 kevin
root@ubuntu:/samba#
root@ubuntu:/samba# sudo smbpasswd -a kevin
New SMB password:Retype new SMB password:Added user kevin.
root@ubuntu:/samba#

Step 9: Restart service

root@ubuntu:/samba# sudo service smbd restart
smbd stop/waiting
smbd start/running, process 11043

Step 10: Test Share folder and samba configuration

root@ubuntu:/samba# sudo testparm
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section “[PublicShare]”
Processing section “[kevin.ngo.ithelpblog]”
Loaded services file OK.
WARNING: You have some share names that are longer than 12 characters.
These may not be accessible to some older clients.
(Eg. Windows9x, WindowsMe, and smbclient prior to Samba 3.0.)
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions
[global]
netbios name = UBUNTU13
server string = IThelpblog Samba Server %v
map to guest = Bad User
dns proxy = No
idmap config * : backend = tdb[PublicShare]
path = /samba/share
read only = No
guest ok = Yes[kevin.ngo.ithelpblog]
path = /samba/kevin
valid users = @itgroup
read only = No
root@ubuntu:/samba#

Step 11: Now we can access samba server with User authentication

ubuntu samba 2

 

That’s done. Thanks for using IThelpblog.com.

 

Leave a reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>