Samba

From Schmid.wiki
Jump to: navigation, search

Contents

Windows Filesharing Protocol

  • Server Message Block (SMB) protocol: the old protocol for file sharing, based on NetBIOS and NetBEUI
  • Common Internet File System (CIFS): Microsoft protocol suite for network sharing, based upon SMB

Samba

What Is Samba?

samba uses the CIFS protocol to communicate with Windows boxes

Installation

SMB must be enabled in the kernel:

File Systems -> Network File Systems:
<*> SMB file system support (to mount Windows shares etc.)                               
[ ]   Use a default NLS
<*> CIFS support (advanced network filesystem for Samba, Window and other CIFS compliant

compile and install new kernel

# emerge samba
# mkdir /home/schmid/shared
# vim /etc/samba/smb.conf
[global]
  workgroup = SOMEGROUP
  server string = Samba Server %v
  log file = /var/log/samba/log.%m
  max log size = 50
  socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
  interfaces = lo eth0
  bind interfaces only = yes
  hosts allow = 127.0.0.1 192.168.0.
  hosts deny = 0.0.0.0/0
  security = user                        <- most important setting!
  dns proxy = no
  time server = true

[public]
  comment = public data
  browseable = yes
  public = yes
  writeable = yes
  create mode = 0766
  path = /data/public
  valid users = user1 user2

[private]
  comment = private data
  hosts allow = 192.168.0.xxx, 192.168.0.yyy  <- where 'xxx' and 'yyy' are the
  browseable = yes                               allowed IPs
  public = yes
  writeable = yes
  create mode = 0766
  path = /data/private
  valid users = user1                         <- only allow user1

An you must create the users, even if they already exist in the Linux system:

# smbpasswd -a user1
<enter password>

Start Samba during boot:

# rc-update -a samba boot

Either Use AutoFS for Mounting Or

# mkdir /mnt/w98
# mkdir /mnt/gericom

add mount points to /etc/fstab:

//w98/schmid		/mnt/w98	smbfs		credentials=/home/schmid/.smbpw 0 0
//gericom/jakob 	/mnt/gericom	smbfs		defaults		0 0

Tools

query for NetBIOS name on an IP address

$ nmblookup -A 192.168.0.23

get IP address for 'winbucket'

$ nmblookup winbucket

get command-line interface to control 'winbucket\shared' with no password

$ smbclient -N //winbucket/shared

list contents of 'winbucket\shared'

$ smbclient -N //winbucket/shared -cls

Filesharing On Windows XP Pro

reference: http://www.practicallynetworked.com/sharing/xp_filesharing/

I couldn't get it to work with anything but simple filesharing.

Permitting Network Access Without A Password

To allow users to log onto their computers without a password and then access the XP Professional machine without a password, you must make a security policy change:

  1. Go to Control Panel | Performance and Maintenance | Administrative Tools | Local Security Policy. (or run 'secpol.msc')
  2. Expand Local Policies | Security Options.
  3. Double-click Accounts: Limit local account use of blank passwords to console login only, which is enabled by default. Disable this option and click OK.

Create Share From Folder

  1. Right-click the folder and select Sharing and Security.
  2. On the Sharing tab, select Share this folder and enter a share name.
  3. Add a comment if desired.  This comment describes the share and appears in My Network Places on other computers.
  4. Leave the User limit alone. On XP professional, the maximum limit is 10.
Personal tools