Installing Samba on Linux - testmy.net resource / tool
Home
Welcome, Guest. Please login or register.
Did you miss your activation email?

 



donations help testmy.net pay for the very high cost to run the site. Any amount is greatly appreciated.
Click to read why...

  spcr
    
News : Have an idea that will make testmy.net better?  Click here to post it!  We love to hear feedback, user feedback like yours have helped build testmy.net over the years.. true story wink August 28, 2008, 11:30:26 PM
testmy.net Broadband  |  Main Forum  |  Guides  |  Topic: Installing Samba on Linux Advanced search
  0 Members and 1 Guest are viewing this topic. « previous next »
Pages 1 Go Down
Author
Topic: Installing Samba on Linux  (Read 8089 times)
php
Vice Admin
TMN Seasoned Veteran
*
Offline Offline

Gender: Male
Posts: 5125



View Profile
« on: February 05, 2006, 03:03:20 PM »

***Setting up Samba on Linux***

Samba is a Unix/Linux application that adds SMB (Server Message Block) protocol abilities.  This protocol is used by many operating systems, including Windows and OS/2.  This guide will show how to set up Samba to allow a Unix/Linux machine to share files.
As an example... I set up Samba on a Bonzai Linux machine for use as a network file server for my home network.


For this guide, I am assuming:
  • You have Debian Linux or a Debian-based Linux Distribution installed (ex. Bonzai)
    Note: this guide can be applied to other distributions, but file locations and commands may be different.
  • Your distribution sources list is set up properly
  • You know the basics of networking and sharing files
  • You are logged in as root
  • If you do not have the apt-get command, you know how to compile and make packages (links for Samba and SWAT downloads at the bottom)


# denotes commands typed in the shell

Several Samba related tools are available, for this guide I will only be installing SWAT (Samba Web Administration Tool), a web interface for configuring Samba.

Installing Samba

Samba only:
#apt-get install samba

Samba and SWAT:
#apt-get install samba swat

It will ask you a few basic questions about the Samba configuration, enter the correct information for your needs.


Create a directory to share
The following commands are only examples
#cd /home/user
#mkdir shared

Set up the password file
#cd /etc
#vim smbpasswd
Type :wq and press enter to save and quit

Configure Samba configuration file
(If you have KDE or Gnome installed, it may be easier to edit the config files from there unless you know how to use vi or vim)

The configuration file is typically located at /etc/samba/smb.conf
Sample configuration file:
Code:
[global]
netbios name = fileserver
server string = %h server (Samba %v)
smb passwd file = /etc/smbpasswd  [i]<-- edit this line[/i]
passdb backend = tdbsam, guest
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\sUNIX\spassword:* %n\n *Retype\snew\sUNIX\spassword:* %n\n .
syslog = 0
log file = /var/log/samba/log.%m
max log size = 1000
load printers = no
ldap ssl = no
invalid users = root [i]<-- recommended[/i]
valid users = user
admin users = user
write list = user
hosts allow = 192.168.0., 127.0.0.1
hosts deny 0.0.0.0/0
map hidden = Yes

[shared]
comment = Shared Files
path = /home/user/shared
read only = no
create mask = 0755
delete readonly = Yes
guest ok = no
case sensitive = no

The above sample file allows connections only from 192.168.0.* and sets up a shared folder at /home/user/shared with read/write permissions, accessible only by user.  It disallows root from accessing shared folders (recommended for security purposes)

Check the config file:
#testparm

Restart the server for changes to take effect:
#/etc/init.d/samba restart

Now that the configuration file is set up, add users.

#adduser user (If the user doesn't exist already)
Enter the requested information.

#smbpasswd -a user (Note: user must be an existing user on the system)
Enter the password at the prompt and press enter.


To map a drive from Windows:
Right-click on My Computer -> Map Network Drive... -> Pick a drive letter, type \\fileserver\shared -> Check Reconnect at logon if desired -> Click Finish -> enter username and password when requested.

Complete!

Use SWAT to change settings and manage Samba at http://fileserver:901
Log in with username and password you set up, or root for full configuration access.

Links:
http://www.samba.org
Download Samba
Samba Documentation

SWAT should be installed with Samba if you compiled Samba yourself.
To set up SWAT, edit /etc/inetd.conf or /etc/xinetd.conf and add:
Code:
# Swat Samba Web Admin Tool
service swat
{
port = 901
socket_type = stream
wait = no
only_from = 127.0.0.1
user = root
server = /usr/local/samba/sbin/swat
log_on_failure += USERID
disable = no
}
(Code from http://www.geekspeek.org)

Guide written by php
Logged

Send this topic Print  Pages 1 Go Up
testmy.net Broadband  |  Main Forum  |  Guides  |  Topic: Installing Samba on Linux « previous next »
Jump to:  

    
testmy.net's forum is proudly Powered by SMF | SMF © 2006-2007, Simple Machines LLC
Bookmark: Del.icio.us    StumbleUpon
 
 

 

© 1999-2008 testmy.net - Contact - Legal - Facts & FAQs
Page Loading Stats: This forum Page created in 0.101 seconds with 24 queries.