elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Security Series.XSS. [Cross Site Scripting]


+  Foro de elhacker.net
|-+  Sistemas Operativos
| |-+  GNU/Linux (Moderador: MinusFour)
| | |-+  [Solucionado] SSH y SFTP
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: [Solucionado] SSH y SFTP  (Leído 13,519 veces)
venadHD

Desconectado Desconectado

Mensajes: 94

Donde hay hackers, tambien hay crackers.


Ver Perfil WWW
[Solucionado] SSH y SFTP
« en: 18 Febrero 2015, 20:30 pm »

Resulta que instale pure-ftpd y algunos que otras dependencias de el, lo desinstale hace unas horas, y todos los usuarios que tenia dejaron de funcionar (Al logear por SFTP, excepto, 1, pondre un ejemplo)

root
user1
user2
user3

root puede loggearse
user1 puede loggearse
user2 NO puede loggearse
user3 NO puede loggearse

La configuracion era la siguiente para estos usuarios

Código:
#Match group mtahost
  #  ChrootDirectory %h
    #X11Forwarding no
    #AllowTcpForwarding no
    #ForceCommand internal-sftp

(Sin comentar, obvio)
Solo funciona un usuario, al intentar loggear con ellos, me salta el siguiente error:

Código:
Registro de autenticación (usa el registro de sesión para más detalles):
Usando el nombre de usuario "user2".

Autenticación fallida!
El servidor ha rechazado la conexión SFTP, pero escucha las conexiones FTP.

 desea utilizar el protocolo FTP en lugar de SFTP? Prefiera el uso de cifrado (SFTP).

Ya solo activando el ChrootDirectory, ya me tira error, por que puede ser?

Registro de sesion

Código:
. 2015-02-18 20:36:43.203 --------------------------------------------------------------------------
. 2015-02-18 20:36:43.203 WinSCP Version 5.5.6 (compilación 4746) (OS 5.1.2600 Service Pack 3 - Microsoft Windows XP)
. 2015-02-18 20:36:43.203 Configuration: HKEY_CURRENT_USER\Software\Martin Prikryl\WinSCP 2\
. 2015-02-18 20:36:43.203 Local account: Andrelyoko\Andre
. 2015-02-18 20:36:43.203 Working directory: C:\Documents and Settings\Andre\Escritorio
. 2015-02-18 20:36:43.203 Process ID: 1376
. 2015-02-18 20:36:43.203 Command-line: "C:\Archivos de programa\WinSCP\WinSCP.exe"
. 2015-02-18 20:36:43.203 Time zone: Current: GMT+1, Standard: GMT+1 (Hora estándar romance), DST: GMT+2 (Hora de verano romance), DST Start: 29/03/2015, DST End: 25/10/2015
. 2015-02-18 20:36:43.203 Login time: miércoles, 18 de febrero de 2015 20:36:43
. 2015-02-18 20:36:43.203 --------------------------------------------------------------------------
. 2015-02-18 20:36:43.203 Session name: humber (Site)
. 2015-02-18 20:36:43.203 Host name: 5.175.139.216 (Port: 22)
. 2015-02-18 20:36:43.203 User name: humber (Password: Yes, Key file: No)
. 2015-02-18 20:36:43.203 Tunnel: No
. 2015-02-18 20:36:43.203 Transfer Protocol: SFTP (SCP)
. 2015-02-18 20:36:43.203 Ping type: -, Ping interval: 30 sec; Timeout: 15 sec
. 2015-02-18 20:36:43.203 Proxy: none
. 2015-02-18 20:36:43.203 Send buffer: 262144
. 2015-02-18 20:36:43.203 SSH protocol version: 2; Compression: No
. 2015-02-18 20:36:43.203 Bypass authentication: No
. 2015-02-18 20:36:43.203 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: Yes
. 2015-02-18 20:36:43.203 GSSAPI: Forwarding: No; Server realm:
. 2015-02-18 20:36:43.203 Ciphers: aes,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
. 2015-02-18 20:36:43.203 SSH Bugs: A,A,A,A,A,A,A,A,A,A
. 2015-02-18 20:36:43.203 Simple channel: Yes
. 2015-02-18 20:36:43.203 Return code variable: Autodetect; Lookup user groups: A
. 2015-02-18 20:36:43.203 Shell: default
. 2015-02-18 20:36:43.203 EOL: 0, UTF: 2
. 2015-02-18 20:36:43.203 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes
. 2015-02-18 20:36:43.203 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No
. 2015-02-18 20:36:43.203 SFTP Bugs: A,A
. 2015-02-18 20:36:43.203 SFTP Server: default
. 2015-02-18 20:36:43.203 Local directory: C:\Documents and Settings\Andre\Mis documentos, Remote directory: /home/humber, Update: Yes, Cache: Yes
. 2015-02-18 20:36:43.203 Cache directory changes: Yes, Permanent: Yes
. 2015-02-18 20:36:43.203 DST mode: 0; Timezone offset: 0h 0m
. 2015-02-18 20:36:43.203 --------------------------------------------------------------------------
. 2015-02-18 20:36:43.328 Looking up host "5.175.139.216"
. 2015-02-18 20:36:43.328 Connecting to 5.175.139.216 port 22
. 2015-02-18 20:36:43.406 Selecting events 63 for socket 944
. 2015-02-18 20:36:43.421 Waiting for the server to continue with the initialization
. 2015-02-18 20:36:43.421 Looking for incoming data
. 2015-02-18 20:36:43.421 Looking for network events
. 2015-02-18 20:36:43.421 Detected network event
. 2015-02-18 20:36:43.421 Enumerating network events for socket 944
. 2015-02-18 20:36:43.421 Enumerated 18 network events making 18 cumulative events for socket 944
. 2015-02-18 20:36:43.421 Handling network write event on socket 944 with error 0
. 2015-02-18 20:36:43.421 Handling network connect event on socket 944 with error 0
. 2015-02-18 20:36:43.421 Looking for network events
. 2015-02-18 20:36:43.500 Detected network event
. 2015-02-18 20:36:43.500 Enumerating network events for socket 944
. 2015-02-18 20:36:43.500 Enumerated 1 network events making 1 cumulative events for socket 944
. 2015-02-18 20:36:43.500 Handling network read event on socket 944 with error 0
. 2015-02-18 20:36:43.500 Server version: SSH-2.0-OpenSSH_6.0p1 Debian-4+deb7u2
. 2015-02-18 20:36:43.500 Using SSH protocol version 2
. 2015-02-18 20:36:43.500 We claim version: SSH-2.0-WinSCP_release_5.5.6
. 2015-02-18 20:36:43.500 Waiting for the server to continue with the initialization
. 2015-02-18 20:36:43.500 Looking for incoming data
. 2015-02-18 20:36:43.500 Looking for network events
. 2015-02-18 20:36:43.578 Detected network event
. 2015-02-18 20:36:43.578 Enumerating network events for socket 944
. 2015-02-18 20:36:43.578 Enumerated 1 network events making 1 cumulative events for socket 944
. 2015-02-18 20:36:43.578 Handling network read event on socket 944 with error 0
. 2015-02-18 20:36:43.578 Doing Diffie-Hellman group exchange
. 2015-02-18 20:36:43.578 Waiting for the server to continue with the initialization
. 2015-02-18 20:36:43.578 Looking for incoming data
. 2015-02-18 20:36:43.578 Looking for network events
. 2015-02-18 20:36:43.781 Detected network event
. 2015-02-18 20:36:43.781 Enumerating network events for socket 944
. 2015-02-18 20:36:43.781 Enumerated 1 network events making 1 cumulative events for socket 944
. 2015-02-18 20:36:43.781 Handling network read event on socket 944 with error 0
. 2015-02-18 20:36:43.796 Doing Diffie-Hellman key exchange with hash SHA-256
. 2015-02-18 20:36:44.625 Waiting for the server to continue with the initialization
. 2015-02-18 20:36:44.625 Looking for incoming data
. 2015-02-18 20:36:44.625 Looking for network events
. 2015-02-18 20:36:44.828 Detected network event
. 2015-02-18 20:36:44.828 Enumerating network events for socket 944
. 2015-02-18 20:36:44.828 Enumerated 1 network events making 1 cumulative events for socket 944
. 2015-02-18 20:36:44.828 Handling network read event on socket 944 with error 0
. 2015-02-18 20:36:46.031 Verifying host key rsa2 0x10001,0xb7f3153dc5be4cf5 00a0cfd67bc052be d54201b7bba21598 60d93dd3ce341e3e df532964369b09f9 9e99aee3f717c78b d22b31150b1684d9 c6b73cfbf7770fb7 16a87acc5364e61d 180b5c71f26f896b ac8cfa54bb7a2c2f fcd5994017c9a935 9dc758e6f553513d dacbe915cb256b44 5258f8e32fc5f9c0 e58c51249115403d ed4663eb180de029 1b167f5dbc81f85f dd3a76ad4a29ca8c fee3f07497aa0ab2 e989f604c18c4510 eb7c97a5b8f7ede8 6015937b1e7600ad 6c0909492f7bc89d ea300edea6dc59bc a449d6ece647be5f 0a9f260e66573277 06116bcb3c9013f9 c6d187145556c950 fa9fb676723483d8 410d4e72db8be0a1 955379207b3f56db  with fingerprint ssh-rsa 2048 b7:12:16:1c:c3:de:ea:cb:f8:1a:1b:5e:66:3e:9e:fb
. 2015-02-18 20:36:46.046 Host key matches cached key
. 2015-02-18 20:36:46.046 Selecting events 63 for socket 944
. 2015-02-18 20:36:46.046 Host key fingerprint is:
. 2015-02-18 20:36:46.046 ssh-rsa 2048 b7:12:16:1c:c3:de:ea:cb:f8:1a:1b:5e:66:3e:9e:fb
. 2015-02-18 20:36:46.046 Initialised AES-256 SDCTR client->server encryption
. 2015-02-18 20:36:46.046 Initialised HMAC-SHA-256 client->server MAC algorithm
. 2015-02-18 20:36:46.046 Initialised AES-256 SDCTR server->client encryption
. 2015-02-18 20:36:46.046 Initialised HMAC-SHA-256 server->client MAC algorithm
. 2015-02-18 20:36:46.046 Waiting for the server to continue with the initialization
. 2015-02-18 20:36:46.046 Looking for incoming data
. 2015-02-18 20:36:46.046 Looking for network events
. 2015-02-18 20:36:46.218 Detected network event
. 2015-02-18 20:36:46.218 Enumerating network events for socket 944
. 2015-02-18 20:36:46.218 Enumerated 1 network events making 1 cumulative events for socket 944
. 2015-02-18 20:36:46.218 Handling network read event on socket 944 with error 0
! 2015-02-18 20:36:46.218 Using username "humber".
. 2015-02-18 20:36:46.250 Waiting for the server to continue with the initialization
. 2015-02-18 20:36:46.250 Looking for incoming data
. 2015-02-18 20:36:46.250 Looking for network events
. 2015-02-18 20:36:46.359 Detected network event
. 2015-02-18 20:36:46.359 Enumerating network events for socket 944
. 2015-02-18 20:36:46.359 Enumerated 1 network events making 1 cumulative events for socket 944
. 2015-02-18 20:36:46.359 Handling network read event on socket 944 with error 0
. 2015-02-18 20:36:46.359 Prompt (7, SSH password, , &Contraseña)
. 2015-02-18 20:36:46.359 Using stored password.
. 2015-02-18 20:36:46.359 Sent password
. 2015-02-18 20:36:46.359 Waiting for the server to continue with the initialization
. 2015-02-18 20:36:46.359 Looking for incoming data
. 2015-02-18 20:36:46.359 Looking for network events
. 2015-02-18 20:36:46.531 Detected network event
. 2015-02-18 20:36:46.531 Enumerating network events for socket 944
. 2015-02-18 20:36:46.531 Enumerated 1 network events making 1 cumulative events for socket 944
. 2015-02-18 20:36:46.531 Handling network read event on socket 944 with error 0
. 2015-02-18 20:36:46.531 Access granted
. 2015-02-18 20:36:46.531 Opening session as main channel
. 2015-02-18 20:36:46.531 Waiting for the server to continue with the initialization
. 2015-02-18 20:36:46.531 Looking for incoming data
. 2015-02-18 20:36:46.531 Looking for network events
. 2015-02-18 20:36:46.531 Detected network event
. 2015-02-18 20:36:46.531 Enumerating network events for socket 944
. 2015-02-18 20:36:46.531 Enumerated 32 network events making 32 cumulative events for socket 944
. 2015-02-18 20:36:46.531 Handling network close event on socket 944 with error 0
. 2015-02-18 20:36:46.531 Selecting events 0 for socket 944
. 2015-02-18 20:36:46.531 Server unexpectedly closed network connection
. 2015-02-18 20:36:46.531 Knocking FTP port.
. 2015-02-18 20:36:47.640 FTP port opened, will suggest using FTP protocol.
* 2015-02-18 20:36:47.671 (EFatal) El servidor cerró inesperadamente la conexión
* 2015-02-18 20:36:47.671 Registro de autenticación (usa el registro de sesión para más detalles):
* 2015-02-18 20:36:47.671 Usando el nombre de usuario "humber".
* 2015-02-18 20:36:47.671
* 2015-02-18 20:36:47.671 Autenticación fallida!
* 2015-02-18 20:36:47.671 El servidor ha rechazado la conexión SFTP, pero escucha las conexiones FTP.
* 2015-02-18 20:36:47.671
* 2015-02-18 20:36:47.671  desea utilizar el protocolo FTP en lugar de SFTP? Prefiera el uso de cifrado (SFTP).


« Última modificación: 25 Febrero 2015, 16:32 pm por venadHD » En línea

venadHD

Desconectado Desconectado

Mensajes: 94

Donde hay hackers, tambien hay crackers.


Ver Perfil WWW
Re: [Problemon de los gordos] SSH y SFTP
« Respuesta #1 en: 18 Febrero 2015, 20:33 pm »

Y si creo un nuevo usuario, pasa lo mismo


En línea

kondrag_X1

Desconectado Desconectado

Mensajes: 157


Ver Perfil
Re: [Problemon de los gordos] SSH y SFTP
« Respuesta #2 en: 18 Febrero 2015, 20:38 pm »

¿Has mirado los logs del SFTP? :¬¬
En línea

venadHD

Desconectado Desconectado

Mensajes: 94

Donde hay hackers, tambien hay crackers.


Ver Perfil WWW
Re: [Problemon de los gordos] SSH y SFTP
« Respuesta #3 en: 18 Febrero 2015, 21:08 pm »

en /var/log no existe ningun log relacionado con SFTP o SSH (Estoy usando debian 7 y OpenSSH)
En línea

MinusFour
Moderador Global
***
Desconectado Desconectado

Mensajes: 5.529


I'm fourth.


Ver Perfil WWW
Re: [Problemon de los gordos] SSH y SFTP
« Respuesta #4 en: 18 Febrero 2015, 23:46 pm »

Asegurate que:

1) Tus usuarios tengan un directorio home.
2) Este habilitado internal-sftp:

Código:
Subsystem sftp internal-sftp

Tambien... acerca de ChrootDirectory:

Citar
All components of  the  path‐name  must  be root-owned directories that are not writable by any other user or group.

3) Que tus usuarios pertenezcan al grupo mtahost.
En línea

venadHD

Desconectado Desconectado

Mensajes: 94

Donde hay hackers, tambien hay crackers.


Ver Perfil WWW
Re: [Problemon de los gordos] SSH y SFTP
« Respuesta #5 en: 19 Febrero 2015, 02:37 am »

Si, si, esta todo perfecto, al cabo de un tiempo fallo, es decir, funcionaba a la perfeccion y derrepente falló, el archivo está bien y pertenecen al grupo, los directorios bajo root, tal cual lo pusiste y aun asi error de autentificacion
En línea

MinusFour
Moderador Global
***
Desconectado Desconectado

Mensajes: 5.529


I'm fourth.


Ver Perfil WWW
Re: [Problemon de los gordos] SSH y SFTP
« Respuesta #6 en: 19 Febrero 2015, 04:26 am »

Si, si, esta todo perfecto, al cabo de un tiempo fallo, es decir, funcionaba a la perfeccion y derrepente falló, el archivo está bien y pertenecen al grupo, los directorios bajo root, tal cual lo pusiste y aun asi error de autentificacion

Creo que los atentos de autentificacion deben estar en:

Código:
/var/log/auth.log

Revisa si hay algo sospechoso ahi.

Edit: Para activar los logs de SFTP en OpenSSH, tienes que modificar sshd_config:

Código:
Subsystem   sftp    internal-sftp -f AUTH -l INFO

Y deberian aparecer los mensajes en /var/log/messages.
« Última modificación: 19 Febrero 2015, 04:32 am por MinusFour » En línea

venadHD

Desconectado Desconectado

Mensajes: 94

Donde hay hackers, tambien hay crackers.


Ver Perfil WWW
Re: [Problemon de los gordos] SSH y SFTP
« Respuesta #7 en: 25 Febrero 2015, 16:23 pm »

Acabé por instalar una servidor FTP. Denege el acceso a SFTP (Por si acaso surge la magia y se arregla solo (No es la primera vez que me pasa))

Archivo /var/log/auth.log
Código:
 
No, no se me ha olvidado pegar nada.
En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Servidor web, sftp, ssh casero « 1 2 »
Hardware
mk_137 13 9,762 Último mensaje 3 Junio 2010, 17:23 pm
por Artikbot
Manual FreeSSHd para crear servidores SSH, SCP y SFTP en Windows : Publicado
Noticias
wolfbcn 0 4,621 Último mensaje 13 Febrero 2011, 02:50 am
por wolfbcn
SFTP y FTPS : Diferencias entre SFTP y FTPS para la transferencia segura de ...
Noticias
wolfbcn 1 3,876 Último mensaje 12 Mayo 2011, 14:56 pm
por [u]nsigned
FileZilla 3.5.0: Cliente FTP y SFTP gratuito en versión estable
Software
wolfbcn 0 2,192 Último mensaje 23 Mayo 2011, 13:17 pm
por wolfbcn
Problema con sftp
GNU/Linux
sagmont 2 2,399 Último mensaje 25 Octubre 2013, 00:24 am
por sagmont
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines