WARNING: This is an Archive - Try the New TestMy.net
Home
 
Welcome, Guest. Please login or register.

 
  spcr
Home Installing Samba on Linux
    
  Home    Help    Search    Login    Register  
 
News : angel Do you think your good enough to write news for testmy.net?  Shoot me a PM and you may be accepted to write for us, a title of nobility angry October 23, 2014, 03:05:12 AM
oldtestmy.net forums  |  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 11390 times)
php
Vice Admin
TMN Seasoned Veteran
*
Offline Offline

Gender: Male
Posts: 5121



View Profile
« on: February 05, 2006, 02: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
oldtestmy.net forums  |  Main Forum  |  Guides  |  Topic: Installing Samba on Linux « previous next »
Jump to:  

    


 

 

 

2006 testmy.net - Contact - Legal - This is an old version: Try Speed Test Version 14