Apuntes Samba
Apuntes Samba
Apuntes Samba
# /etc/init.d/samba restart
Stopping Samba daemons: nmbd smbd.
Starting Samba daemons: nmbd smbd.
/etc/samba/smb.conf
Para que un usuario de windows pueda entrar en samba ese usuario debe existir en la maquina linux
tambien (no hace falta que el password coincida o exista).
Para que el samba mire los usuario de un dominio windows utilizaremos winbind
apt-get install winbind
Para comprobar si esta escuchando mirar si escucha en los puertos 139 y 445
[global]
[homes]
Según el usuario que se conecte desde un máquina windows verá un recurso que se ofrece.
[printers]
[global]
## Browsing/Identification ###
# Change this to the workgroup/NT-domain name your Samba server will part of
workgroup = CURSO
# Esto hay que añadirlo para que tenga nombre de NetBIOS
netbios name = SERVIDOR-9
# server string is the equivalent of the NT Description field
server string = %h server
# JAS Añadimos
username map = /etc/samba/smbusers
# This will prevent nmbd to search for NetBIOS names through DNS.
dns proxy = no
# What naming service and in what order should we use to resolve host names
# to IP addresses
; name resolve order = lmhosts host wins bcast
# Only bind to the named interfaces and/or networks; you must use the
# 'interfaces' option above to use this.
# It is recommended that you enable this feature if your Samba machine is
# not protected by a firewall or is a firewall itself. However, this
# option cannot handle dynamic or non-broadcast interfaces correctly.
; bind interfaces only = true
# This tells Samba to use a separate log file for each machine
# that connects
log file = /var/log/samba/log.%m
# If you want Samba to only log through syslog then set the following
# parameter to 'yes'.
; syslog only = no
# "security = user" is always a good idea. This will require a Unix account
# in this server for every user accessing the server. See
# /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/ServerType.html
# in the samba-doc package for details.
# JAS Puede tener varios tipos USER/SHARE /SERVER /DOMAIN
# El tipo DOMAIN con wmind
security = user
# If you are using encrypted passwords, Samba will need to know what
# password database type you are using.
# Tipo de base de datos
passdb backend = tdbsam
# This boolean parameter controls whether Samba attempts to sync the Unix
# password with the SMB password when the encrypted SMB password in the
# passdb is changed.
; unix password sync = no
# For Unix password sync to work on a Debian GNU/Linux system, the following
# parameters must be set (thanks to Ian Kahan <<[email protected]>
for
# sending the correct chat script for the passwd program in Debian Sarge).
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\sUNIX\spassword:* %n\n
*Retype\snew\sUNIX\spassword:* %n\n *password\supdated\ssuccessfully* .
# This boolean controls whether PAM will be used for password changes
# when requested by an SMB client instead of the program listed in
# 'passwd program'. The default is 'no'.
; pam password change = no
# This allows Unix users to be created on the domain controller via the SAMR
# RPC pipe. The example command creates a user account with a disabled Unix
# password; please adapt to your needs
; add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u
#JAS Samba se integran con CUPs para eso descomentamos las lineas (*)
#
# If you want to automatically load your printer list rather
# than setting them up individually then you'll need this
#(*)
load printers = yes
# When using [print$], root is implicitly a 'printer admin', but you can
# also give this right to other users to add drivers and set printer
# properties
; printer admin = @ntadmin
# Most people will find that this option gives better performance.
# See smb.conf(5) and /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/speed.html
# for details
# You may want to add the following on a Linux system:
# SO_RCVBUF=8192 SO_SNDBUF=8192
socket options = TCP_NODELAY
# The following parameter is useful only if you have the linpopup package
# installed. The samba maintainer and the linpopup maintainer are
# working to ease installation and configuration of linpopup and samba.
; message command = /bin/sh -c '/usr/bin/linpopup "%f" "%m" %s; rm %s' &
# Some defaults for winbind (make sure you're not using the ranges
# for something else.)
; idmap uid = 10000-20000
; idmap gid = 10000-20000
; template shell = /bin/bash
;
; The following was the default behaviour in sarge
; but samba upstream reverted the default because it might induce
; performance issues in large organizations
; See #368251 for some of the consequences of *not* having
; this setting and smb.conf(5) for all details
# JAS Tambien para tema de Domino
; winbind enum groups = yes
; winbind enum users = yes
# File creation mask is set to 0700 for security reasons. If you want to
# create files with group=rw permissions, set next parameter to 0775.
# JAS Mascara de acceso a ficheros
create mask = 0700
# Directory creation mask is set to 0700 for security reasons. If you want to
# create dirs. with group=rw permissions, set next parameter to 0775.
# JAS Mascara para directorios
directory mask = 0700
# Un-comment the following and create the netlogon directory for Domain Logons
# (you need to configure Samba to act as a domain controller too.)
# Esto es para cuando SAMBA haga de PDC
;[netlogon] ; Defino el escrip
; comment = Network Logon Service
; path = /home/samba/netlogon
; guest ok = yes
; writable = no
; share modes = no
[printers]
# JAS . Aquí se ponen las impresoras importadas de CUPS
comment = All Printers
browseable = no
path = /var/spool/samba
printable = yes
public = no
writable = no
create mode = 0700
# The next two parameters show how to auto-mount a CD-ROM when the
# cdrom share is accesed. For this to work /etc/fstab must contain
# an entry like this:
#
# /dev/scd0 /cdrom iso9660 defaults,noauto,ro,user 0 0
#
# The CD-ROM gets unmounted automatically after the connection to the
#
# If you don't want to use auto-mounting/unmounting make sure the CD
# is mounted on /cdrom
#
; preexec = /bin/mount /cdrom
; postexec = /bin/umount /cdrom
PRÁCTICA DE SAMBA
Copiamos una imagen virtual de windows de prueba del servidor con scp:
Luego en el WINXP y como tenemos dado de alta el usuario curso accederá al recurso sin
problemas.
Podremos entrar a un recurso llamado [curso] ya que la definición del recurso HOME reemplaza el
nombre por el nombre del usuario.
[homes]
comment = Home Directories
browseable = no
# By default, the home directories are exported read-only. Change next
# parameter to 'yes' if you want to be able to write to them.
writable = yes
Instalamos swat
# aptitude install swat
Accedemos a traber del puerto 901 del localhost. A traves de esta aplicación podemos administrar
de forma grafica el SAMBA
Server Comment
--------- -------
Workgroup Master
--------- -------
CURSO WINXP
smbfs: