Linux/Samba/Simple File Server

From Omnia
< Linux‎ | Samba
Jump to navigation Jump to search

Simple File Server

Install Samba:

yum install samba samba-client

Create a share folder:

mkdir /files

Samba configuration files:

/etc/samba/

Modify samba configuration and add our file share:

[global]
  # Computer name, workgroup and description:
  workgroup = WORKGROUP
  netbios name = DATA
  server string = File Server
  
  # Logs
  # default: <empty>)
  log file = /var/log/samba/%m.log
  # (default: 5000)
  max log size = 50
  
  # User map (default: <empty>)
  username map = /etc/samba/smbusers
  # Encrypt passwords (default: yes)
  encrypt passwords = yes
  # Security scheme (default: user)
  security = user
  # Password backend (default: smbpasswd)
  passdb backend = tdbsam
  
  # Browser Control Options:
  # set local master to no if you don't want Samba to become a master
  # browser on your network. Otherwise the normal election rules apply
  # (default: yes)
  local master = no
  # Preferred Master causes Samba to force a local browser
  # election on startup
  # and gives it a slightly higher chance of winning the election
  # (default: auto)
  preferred master = no

  # Should Samba use the configured DNS server
  # (default: yes)
  dns proxy = no

  # advertise this is a time server
  time server = Yes

  # Disable printers:
  load printers = no
  printing = bsd
  printcap name = /dev/null
  disable spoolss = yes
  show add printer wizard = no

[files]
  comment = File Share
  path = /data/files
  writeable = yes
  browseable = yes
  valid users = trogdor kenneth
  create mask = 0660
  directory mode = 0770

Create linux user:

adduser <user>

Add the root user to the SAMBA password database.

smbpasswd -a <samba_user>

Map the Samba user to a local linux user

echo "<linux_user> = <samba_user>" >> /etc/samba/smbusers
echo "root = Administrator" >> /etc/samba/smbusers

Give user permission to folder:

chown <user> /files

Restart Samba:

service smb restart

Guest File Server

See Guest File Server

keywords