martes, 24 de mayo de 2011

clase de linux 24-05-11 configurar samba server - samba-swat -

configurar samba server

#============================ Share Definitions ==============================

[homes]
        comment = Home Directories
        browseable = no
        writable = yes
;       valid users = %S
;       valid users = MYDOMAIN\%S
[compartido]
        comment = Aqui se comparte una ruta de linux
        browseable = yes
        writable = yes
        path = /home/samba1
        public = yes
        create mode = 0777 #crea permisos como el CHMOD el 0(cero) es el permiso especial


[printers]
        comment = All Printers
        path = /var/spool/samba
        browseable = no

haciendo un test si esta correcto todo

[root@localhost etc]# vim /etc/samba/smb.conf
[root@localhost etc]# testparm
Load smb config files from /etc/samba/smb.conf
Processing section "[homes]"
Processing section "[compartido]"
Processing section "[printers]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions

[global]
        workgroup = LAB_A14
        server string = JAVIER
        passdb backend = tdbsam
        cups options = raw

[homes]
        comment = Home Directories
        read only = No
        browseable = No

[compartido]
        comment = Aqui se comparte una ruta de linux
        path = /home/samba1
        read only = No
        create mask = 0777
        guest ok = Yes

[printers]
        comment = All Printers
        path = /var/spool/samba
        printable = Yes
        browseable = No
[root@localhost etc]#
[root@localhost etc]#

cramso un usuario para el samba

[root@localhost etc]# useradd samba1
[root@localhost etc]# passwd samba1
Changing password for user samba1.
New UNIX password:
BAD PASSWORD: it is too simplistic/systematic
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@localhost etc]#

ahora le decimos que samba1 se va a conectar solo a samba con
[root@localhost etc]#
[root@localhost etc]# smbpasswd -a samba1

[root@localhost etc]#
[root@localhost etc]# smbpasswd -a samba1
New SMB password:
Retype new SMB password:
Added user samba1.
[root@localhost etc]#

reiniciamos el servicio para guardar los cambios
[root@localhost etc]# service smb restart
Apagando los servicios SMB:                                [FALLÓ]
Apagando los servicios NMB:                                [FALLÓ]
Iniciando servicios SMB:                                   [  OK  ]
Iniciando servicios NMB:                                   [  OK  ]
[root@localhost etc]#

ahora deshabilitaremos el CLINUX

son

[root@localhost etc]# setup
dentro de esto vamos a FIREWALL

y despues deshabilitamos el  SELinux: Obediente 
Nivel de seguridad: ( ) Habilitado (*) Deshabilitado   




Un cortafuegos le protege frente a intrusiones no       │                             
                             │ autorizadas a la red.Al habilitar un cortafuegos        │                             
                             │ bloquea todas las conexiones entrantes. Si inhabilita   │                             
                             │ el cortafuegos entonces permitirá la entrada de todas   │                             
                             │ las conexiones, lo que no es recomendable.              │                             
                             │                                                         │                             
                             │  Nivel de seguridad: ( ) Habilitado (*) Deshabilitado   │                             
                             │                                                         │                             
                             │                 SELinux: Obediente                      │                             
                             │                          Permisivo                      │                             
                             │                          Deshabilitado                  │                             
                             │                                                         │                             
                             │    ┌─────────┐     ┌──────────────┐     ┌──────────┐    │                             
                             │    │ Aceptar │     │ Personalizar │     │ Cancelar │    │                             
                             │    └─────────┘     └──────────────┘     └──────────┘    │                             
                             │                                                         │                             
                             │                                                      


[root@localhost etc]# cd /etc/xinetd.d
[root@localhost xinetd.d]# ls
amanda     chargen-dgram   daytime-dgram   echo-dgram    gssftp       ktalk   rmcp   talk           time-dgram
amandaidx  chargen-stream  daytime-stream  echo-stream   klogin       ntalk   rsh    tcpmux-server  time-stream
amidxtape  clase1.txt      discard-dgram   eklogin       krb5-telnet  rexec   rsync  telnet         uucp
auth       cvs             discard-stream  ekrb5-telnet  kshell       rlogin  swat   tftp
[root@localhost xinetd.d]# vim swat

 # default: off
# description: SWAT is the Samba Web Admin Tool. Use swat \
#              to configure your Samba server. To use SWAT, \
#              connect to port 901 with your favorite web browser.
service swat
{
        port            = 901
        socket_type     = stream
        wait            = no
        only_from       = 10.10.25.29
        user            = root
        server          = /usr/sbin/swat
        log_on_failure  += USERID
        disable         = no
}
~

reiniciamos el servicio

[root@localhost xinetd.d]# service xinetd restart
Parando xinetd:                                            [  OK  ]
Iniciando xinetd:                                          [  OK  ]
[root@localhost xinetd.d]#

entramos a internet
http://10.10.25.29:901/

entramos el usuario samba1 y su clave

y probar en entorno grafico

parecido al webmin

No hay comentarios:

Publicar un comentario