Skip to content

Installation and configuration of Samba in Ubuntu 12.04

September 9, 2013

Samba is Unix based service which is provides files and print services for windows based clients,and which integrate Windows based system to UNIX based architecture, Samba used The SMB(server Massage Box) protocols.

1 apt-cache search samba | more

      • apt-cache search sambasearch for samba packages.
      • | moreGive more result by pressing<enter>.

2 Install Samba

apt-get install samba4 samba4-clients samba4-common-bin system-config-samba

3 Samba configuration files

cd /etc/samba

ls -lrta

smb.conf

Note smb.conf is a configuration file

4 Starting of Samba Script

ls -l /etc/init.d/samba4

samba startup script is placed in /etc/init.d/samba4

find /etc/rc*.d/* -print | xargs ls -l | grep samba

update-rc.d samba4 defaults

find /etc/rc*.d/* -print | xargs ls -l | grep samba

runlevel

      • Identifies the current run level.
        • 0 System Halt
        • 1 Single user
        • 2 Full multi-user mode (Default)
        • 3-5 Same as 2
        • 6 System Reboot

5 Restart Samba with /etc/init.d/samba4 and with service commnads

cd /etc/init.d

./samba4 stop

ps -eaf | grep -v grep | grep samba | wc -l

If gives 0 it means that samba is not running.

./samba4 start

ps -eaf | grep -v grep | grep samba

These lines shows samba is running.

ps -eaf | grep -v grep | grep samba | wc -l

service command

service samba4 status/stop/start/restart

6 Creating samba user account name “Remoteuser”.

Your must be root.

    • useradd -m -d /home/sambauser -c “Remote User” -s /bin/bash Remoteuser
    • grep Remoteuser /etc/passwd
    • passwd abcdef ……..password for remoteuser

7 Browse for Samba

Applications –> System Tools –> Administration –> Samba

A Samba GUI application startup and authenticate.

B Preferences –> Server Settings

–> Basic tab

Place “ServerRoom” in the Workgroup: text box.

Click on the Secure Tab

If you have difficulty to access GUI or Server Mood then try to locate the directives in the /etc/samba/smb.conf file.

workgroup = ServerRoom

–> Security tab

Authentication Mode: User

Encrypt Passwords: Yes

Guest Account: No guest Account

Click on OK.

1 And the set these directives in the /etc/samba/smb.conf file.

encrypt passwords = yes

guest account = no

2 Add a Samba User

click Add User Button

Unix Username: Select Reomeuser

Windows Username: administrator

Samba Password:

Note Does not have to be the same as the Unix Remoteuser password.

3 In samba configuration window add a Samba Share

File –> Add Share

Click the Basic Tab

Directory: /tmp

Share name: tmp

Description: Samba tmp share

Click the Writable Check Box

Click the Visible Check Box

Click the Access Tab

Give Access to the Remoteuser username

Check the Remoteusser check box

Click OK

Now you can access from the window based or other Linux system using these credentials

C samba Network connection

netstat -naop | egrep ‘(:139|:445|:137|:138)’

        • Port 137/UDP – used by nmbd
        • Port 138/UDP – used by nmbd
        • Port 139/TCP – used by smbd
        • Port 445/TCP – used by smbd s

As the connection is between Samba ubuntu server and Window based machine, Samba services are implemented in two way

A smbd, for the file and printer sharing services.

B nmbd, for NetBIOS-to-IP-address name service.

D Samba Log Directory

cd /var/log/samba/

ls -lrta

Samba make a log directory against each IP address and Machine Name

E Shared files and samba user view in samba server

For fiels

cd /etc/samba/

grep -n “\[tmp\]” smb.conf

For user

cd /etc/samba/

grep -n “valid users” smb.conf

Advertisements

From → Linux

Leave a Comment

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

%d bloggers like this: