
One of the most common ways to network Kubuntu and Windows computers is to configure Samba as a File Server. This section covers setting up a Samba server to share files with Windows clients.
The server will be configured to share files with any client on the network without prompting for a password. If the environment requires stricter Access Controls, see the section called “Asegurar un servidor Samba de archivos e impresión”
El primer paso es instalar el paquete samba. Desde un terminal, introduzca:
sudo apt-get install samba
Eso es todo lo que hay que hacer. Samba está listo para ser configurado para compartir archivos.
The main Samba configuration file is located in
/etc/samba/smb.conf
. The default configuration file has a
significant number of comments in order to document various configuration
directives.
Note
En el archivo de configuración predeterminado no se incluyen todas las opciones disponibles. Consulte la página de man de smb.conf
o la colección de HOWTOs de Samba para más información.
Edit the following key/value pairs in the [global] section of
/etc/samba/smb.conf
:workgroup = EXAMPLE ... security = user
The security parameter is farther down in the [global] section, and is commented out by default. Change EXAMPLE to match the actual environment.
Crear una nueva sección al final del archivo, o descomentar uno de los ejemplos para compartir el directorio
[share] comment = Ubuntu File Server Share path = /srv/samba/share browsable = yes guest ok = yes read only = no create mask = 0755
comment: a short description of the share. Adjust to fit as appropriate.
path: la ruta al directorio que se va a compartir.
This example uses
/srv/samba/sharename
because, according to the Filesystem Hierarchy Standard (FHS), /srv is where site-specific data should be served. Technically Samba shares can be placed anywhere on the filesystem as long as the permissions are correct, but adhering to standards is recommended.browsable: permite a los clientes Windows navegar por el directorio compartido usando el Explorador de Windows.
guest ok: permite que los clientes se puedan conectar al recurso sin necesidad de introducir ninguna contraseña.
de sólo lectura: determina si la cuota es de sólo lectura o escritura, si se conceden privilegios. Privilegios de escritura sólo se permiten cuando el valor es no, como se ve en este ejemplo. Si el valor es sí, entonces el acceso a la proporción es de sólo lectura.
create mask: determina los permisos que tendrán los archivos nuevos cuando se creen.
Ahora que Samba ya está configurado, se necesita crear el directorio y cambiar sus permisos. Desde un terminal, teclee:
sudo mkdir -p /srv/samba/share sudo chown nobody.nogroup /srv/samba/share/
Note
The -p switch tells mkdir to create the entire directory tree if it doesn't exist. Change the share name to fit the environment.
Finalmente, reinicie los servicios samba para activar la nueva configuración:
sudo /etc/init.d/samba restart
Warning
La configuración anterior da acceso a cualquier cliente en la red local. Para una configuración más segura, vea the section called “Asegurar un servidor Samba de archivos e impresión”.
From a Windows client, it should now be possible to browse to the Kubuntu file server and see the shared directory. To check that everything is working, try creating a directory from Windows.
To create additional shares, simply create new [dir]
sections in /etc/samba/smb.conf
, and restart
Samba. Make sure that the directory to be shared actually
exists and that the permissions are correct.
Para una configuración más detallada de Samba, consulte la colección de HOWTOs de Samba.
La guía también está disponible en formato impreso.
El libro de O'Reilly Using Samba es otra buena fuente de referencia.