start => servidor
Tabla de Contenidos

Servidor Samba

¿Cómo instalar el Servidor Samba para compartir ficheros?

$ sudo aptitude install samba
$ sudo aptitude install smbfs

¿Cómo añadir/editar/eliminar usuarios de red?

$ sudo smbpasswd -a usuario_del_sistema
$ sudo gedit /etc/samba/smbusers
usuario_del_sistema = "usuario de red"
$ sudo smbpasswd -a usuario_del_sistema
$ sudo smbpasswd -x usuario_del_sistema

¿Cómo convertir los usuarios del sistema en usuarios de red?

$ sudo sudo cat /etc/passwd | /usr/sbin/mksmbpasswd > /etc/samba/smbpasswd

Esto solo crea los usuarios. Tendremos ahora que asignarles una contraseña con smbpasswd.

¿Cómo compartir la carpeta home con solo permisos de lectura (Autenticación=Si)?

$ sudo gedit /etc/samba/smb.conf
...
;   security = user
...
security = user
...
# 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
...
  * Añade la siguiente linea debajo
<file>
username map = /etc/samba/smbusers
$ sudo testparm
$ sudo /etc/init.d/samba restart

¿Cómo compartir la carpeta home con permisos de escritura/lectura (Autenticación=Si)?

$ sudo gedit /etc/samba/smb.conf
...
;   security = user
...
security = user
...
# 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
...
username map = /etc/samba/smbusers
...
# 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 = 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
$ sudo testparm
$ sudo /etc/init.d/samba restart

¿Cómo compartir la carpeta de grupo con solo permisos de lectura (Autenticación=Si)?

$ sudo mkdir /home/group
$ sudo chmod 777 /home/group/
$ sudo chmod +t /home/group/
$ sudo gedit /etc/samba/smb.conf
...
;   security = user
...
security = user
...
# 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
...
username map = /etc/samba/smbusers
[Group]
    comment = Group Folder
    path = /home/group
    public = yes
    writable = no
    valid users = your_system_username1 your_system_username2
    create mask = 0700
    directory mask = 0700
    force user = nobody
    force group = nogroup
$ sudo testparm
$ sudo /etc/init.d/samba restart

¿Cómo compartir la carpeta de grupo con permisos de escritura/lectura (Autenticación=Si)?

$ sudo mkdir /home/group
$ sudo chmod 777 /home/group/
$ sudo chmod +t /home/group/
$ sudo gedit /etc/samba/smb.conf
...
;   security = user
...
security = user
...
# 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
...
username map = /etc/samba/smbusers
[Group]
    comment = Group Folder
    path = /home/group
    public = yes
    writable = yes
    valid users = your_system_username1 your_system_username2
    create mask = 0700
    directory mask = 0700
    force user = nobody
    force group = nogroup
$ sudo testparm
$ sudo /etc/init.d/samba restart

¿Cómo compartir una carpeta publica con solo permisos de lectura (Autenticación=Si)?

$ sudo mkdir /home/public
$ sudo chmod 777 /home/public/
$ sudo chmod +t /home/public/
$ sudo gedit /etc/samba/smb.conf
...
;   security = user
...
security = user
...
# 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
...
username map = /etc/samba/smbusers
[public]
    comment = Public Folder
    path = /home/public
    public = yes
    writable = no
    create mask = 0777
    directory mask = 0777
    force user = nobody
    force group = nogroup
$ sudo testparm
$ sudo /etc/init.d/samba restart

¿Cómo compartir una carpeta publica con permisos de escritura/lectura (Autenticación=Si)?

$ sudo mkdir /home/public
$ sudo chmod 777 /home/public/
$ sudo chmod +t /home/public/
$ sudo gedit /etc/samba/smb.conf
...
;   security = user
...
security = user
...
# 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
...
username map = /etc/samba/smbusers
[public]
    comment = Public Folder
    path = /home/public
    public = yes
    writable = yes
    create mask = 0777
    directory mask = 0777
    force user = nobody
    force group = nogroup
$ sudo testparm
$ sudo /etc/init.d/samba restart

¿Cómo compartir una carpeta publica con solo permisos de lectura (Autenticación=No)?

$ sudo mkdir /home/public
$ sudo chmod 777 /home/public/
$ sudo chmod +t /home/public/
$ sudo gedit /etc/samba/smb.conf
...
;   security = user
...
security = share
[public]
    comment = Public Folder
    path = /home/public
    public = yes
    writable = no
    create mask = 0777
    directory mask = 0777
    force user = nobody
    force group = nogroup
$ sudo testparm
$ sudo /etc/init.d/samba restart

¿Cómo compartir una carpeta publica con permisos de escritura/lectura (Autenticación=No)?

$ sudo mkdir /home/public
$ sudo chmod 777 /home/public/
$ sudo chmod +t /home/public/
$ sudo gedit /etc/samba/smb.conf
...
;   security = user
...
security = share
[public]
    comment = Public Folder
    path = /home/public
    public = yes
    writable = yes
    create mask = 0777
    directory mask = 0777
    force user = nobody
    force group = nogroup
$ sudo testparm
$ sudo /etc/init.d/samba restart