Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[pure-ftpd] Accès via SSL
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index French
View previous topic :: View next topic  
Author Message
Bio
Apprentice
Apprentice


Joined: 17 Mar 2003
Posts: 197
Location: Geneva which should be in Switzerland...

PostPosted: Tue Sep 18, 2007 9:39 am    Post subject: [pure-ftpd] Accès via SSL Reply with quote

Bonjour,

Voilà mon petit problème du jour :wink:

J'ai une Freebox et ma machine Linux connectée dessus. Le port 21 au niveau de la Freebox est forwardé vers mon serveur Gentoo. J'ai installé pure-ftpd comme serveur FTP et j'y accéde sans problème depuis l'extérieur. Celà dit j'aimerais maintenant le sécuriser avec SSL et empécher la connexion avec mot de passe en clair etc...

Je sais que je peux me connecter en secure via SFTP mais je ne veux pas utiliser cette solution. Je veux gérer uniquement des utilisateurs virtuels propres au service FTP et qu'ils soient chrootés sur leur home. De plus je dois limiter la bande passante en fonction des différents users. Hors tout ceci n'est pas géré par SFTP si je ne me trompe pas.

J'ai donc créé mon certificat avec openssl. Mais quand je me connecte depuis l'extérieur Filezilla n'arrive pas à accéder au listing des répertoires :

Voilà ce qui se passe au niveau Filezilla :

Code:

Etat :   Connexion à monserveur...
Etat :   Connecté avec monserveur, négotiation de la connexion SSL...
Réponse :   220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
Réponse :   220-You are user number 1 of 5 allowed.
Réponse :   220-Local time is now 11:32. Server port: 21.
Réponse :   220-This is a private system - No anonymous login
Réponse :   220 You will be disconnected after 3 minutes of inactivity.
Commande :   AUTH TLS
Réponse :   234 AUTH TLS OK.


Puis un pop up me demandant d'accepter mon certificat apparaît : j'accepte...
le processus de connexion reprend

Code:

Etat :   Connexion SSL établie. Attente du message d'accueil...
Commande :   USER bio
Réponse :   331 User bio OK. Password required
Commande :   PASS ******
Réponse :   230-Your bandwidth usage is restricted
Réponse :   230-User bio has group access to:  ftp     
Réponse :   230-OK. Current restricted directory is /
Réponse :   230-Welcome to my ftp server.
Réponse :   230 Happy browsing
Commande :   SYST
Réponse :   215 UNIX Type: L8
Commande :   FEAT
Réponse :   211-Extensions supported:
Réponse :    EPRT
Réponse :    IDLE
Réponse :    MDTM
Réponse :    SIZE
Réponse :    REST STREAM
Réponse :    MLST type*;size*;sizd*;modify*;UNIX.mode*;UNIX.uid*;UNIX.gid*;unique*;
Réponse :    MLSD
Réponse :    TVFS
Réponse :    ESTP
Réponse :    PASV
Réponse :    EPSV
Réponse :    SPSV
Réponse :   211 End.
Commande :   PBSZ 0
Réponse :   200 PBSZ=0
Commande :   PROT P
Réponse :   534 Fallback to [C]
Etat :   Connecté
Etat :   Récupération de la liste de répertoires...
Commande :   PWD
Réponse :   257 "/" is your current location
Commande :   TYPE A
Réponse :   200 TYPE is now ASCII
Commande :   PASV
Réponse :   227 Entering Passive Mode (192,168,0,6,124,209)
Commande :   LIST
Erreur :   Le canal de transfert n'a pas pu être ouvert. Raison : A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
Erreur :   N'a pas pu récupérer la liste du répertoire



Vous me corrigerez si je me trompe mais j'ai le sentiment que c'est un problème de ports, est ce que SSL essaye d'ouvrir un 2ème port en plus du 21? Dans ce cas il faudrait que je le forward depuis l'access point. Si c'est bien le problème comment savoir de quel port il s'agit, je ne crois pas avoir vu de telle option dans la configuration de pure-ftpd.

Merci d'avance
_________________
I'm all in !
Back to top
View user's profile Send private message
Bio
Apprentice
Apprentice


Joined: 17 Mar 2003
Posts: 197
Location: Geneva which should be in Switzerland...

PostPosted: Tue Sep 18, 2007 9:49 am    Post subject: Reply with quote

J'oubliais mon fichier /etc/conf.d/pureftpd

Code:

# Config file for /etc/init.d/pure-ftpd
##Comment variables out to disable its features, or change the values in it... ##

## This variable must be uncommented in order for the server to start ##
IS_CONFIGURED="yes"

## FTP Server,Port (separated by comma) ##
## If you prefer host names over IP addresses, it's your choice:
## SERVER="-S ftp.rtchat.com,21"
## IPv6 addresses are supported.
## !!! WARNING !!!
## Using an invalid IP will result in the server not starting,
## but reporting a correct start!
## SERVER="-S 192.168.0.1,21"
## By default binds to all available IPs.
SERVER="-S 21"

## Number of simultaneous connections in total, and per IP ##
MAX_CONN="-c 5"
MAX_CONN_IP="-C 2"

## Start daemonized in background ##
DAEMON="-B"

## Don't allow uploads if the partition is more full then this var ##
DISK_FULL="-k 90%"

## If your FTP server is behind a NAT box, uncomment this ##
#USE_NAT="-N"

## Authentication mechanisms (others are 'pam', ...) ##
## Further infos can be found in the README file.
#AUTH="-l unix"
AUTH="-lpuredb:/etc/pureftpd.pdb"

## Change the maximum idle time (in minutes) ##
## If this variable is not defined, it will default to 15 minutes.
TIMEOUT="-I 3'"

## Facility used for syslog logging ##
## If this variable is not defined, it will default to the 'ftp' facility.
## Logging can be disabled with '-f none'.
LOG="-f ftp"

## Charset conversion support *experimental* ##
## Only works if USE "charconv" is enabled (only Pure-FTPd >=1.0.21).

## Set the charset of the filesystem.
# CHARCONV="--fscharset <charset>"

## If you want to process each file uploaded through Pure-FTPd, enter the name
## of the script that should process the files below.
## man pure-uploadscript to learn more about how to write this script.
# UPLOADSCRIPT="/path/to/uploadscript"

## Misc. Others ##
#MISC_OTHER="-A -x -j -R -Z"
MISC_OTHER="-A -E -X -U 177:077 -4 -L100:5 -f ftp -G -O w3c:/var/log/pureftpd/pureftpd.log -t 88:500
-R -P 192.168.0.6 -u 1 -r -Y 2"



Si j'utilise l'option

## If your FTP server is behind a NAT box, uncomment this ##
USE_NAT="-N"

Alors je bloque encore plus tôt dans le processus de connexion puisque le serveur me renvoi l'erreur suivante :

Code:

Etat :   Connecté
Etat :   Récupération de la liste de répertoires...
Commande :   PWD
Réponse :   257 "/" is your current location
Commande :   TYPE A
Réponse :   200 TYPE is now ASCII
Commande :   PASV
Réponse :   500 Unknown command
Erreur :   N'a pas pu récupérer la liste du répertoire

_________________
I'm all in !
Back to top
View user's profile Send private message
-KuRGaN-
Veteran
Veteran


Joined: 05 Dec 2004
Posts: 1142
Location: Besançon (25) [FRANCE]

PostPosted: Tue Sep 18, 2007 12:41 pm    Post subject: Reply with quote

Tu devrais forwarder aussi le port 20 sur ton serveur.
_________________
Knight Gent00 Industries RiDeR !!!!
Back to top
View user's profile Send private message
Bio
Apprentice
Apprentice


Joined: 17 Mar 2003
Posts: 197
Location: Geneva which should be in Switzerland...

PostPosted: Tue Sep 18, 2007 5:23 pm    Post subject: Reply with quote

-KuRGaN- wrote:
Tu devrais forwarder aussi le port 20 sur ton serveur.


J'ai essayé sur mon réseau local. Quand j'accéde au serveur FTP via son IP locale : 192.168.0.6 je n'ai pas de problèmes, je me connecte en SSL et j'accède au listing des fichiers.

Par contre si j'accéde à mon IP fixe et donc passe par le routeur de la freebox j'ai toujours le problème mentionné plus haut. Ce qui m'a conforté dans mon idée de problème de redirection de ports. J'ai donc procédé à la méthode bourrine histoire de tester et j'ai forwardé les ports 1 à 65535 UDP et TCP vers ma machine Gentoo. Rien à faire le problème demeure.
_________________
I'm all in !
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index French All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum