[vsftpd] Problème avec la date

Applications, problèmes de configuration réseau
Avatar de l’utilisateur
Shingo
archer de cavalerie
Messages : 151
Inscription : dim. 03 févr. 2013, 19:06

[vsftpd] Problème avec la date

Message par Shingo »

Salut, je viens demander un peu d'aide concernant la configuration de vsftpd sur un serveur web. Ce n'est pas la première fois que je met en place un serveur avec ArchLinux ou Debian, et je remarque qu'à chaque fois que j'installe vsftpd, les secondes ne sont jamais prises en compte dans la date de la dernière modification. C'est assez déroutant, et je me demande si ce n'est pas une restriction de vsftpd. J'ai cherché pendant des heures, non, des jours et je n'ai absolument rien trouvé à ce sujet. Dans mon fichier log, j'ai le format de la date est correct, donc je ne sais pas quoi penser.

Voici mon fichier /etc/vsftpd.conf

Code : Tout sélectionner

# Example config file /etc/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
#
# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
anonymous_enable=NO
#
# Uncomment this to allow local users to log in.
local_enable=YES
#
# Uncomment this to enable any form of FTP write command.
write_enable=YES
#
# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
#local_umask=022
#
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
#anon_upload_enable=YES
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
#anon_mkdir_write_enable=YES
#
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
dirmessage_enable=YES
#
# Activate logging of uploads/downloads.
xferlog_enable=YES
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
connect_from_port_20=YES
#
# If you want, you can arrange for uploaded anonymous files to be owned by
# a different user. Note! Using "root" for uploaded files is not
# recommended!
#chown_uploads=YES
#chown_username=whoever
#
# You may override where the log file goes if you like. The default is shown
# below.
#xferlog_file=/var/log/vsftpd.log
#
# If you want, you can have your log file in standard ftpd xferlog format.
# Note that the default log file location is /var/log/xferlog in this case.
#xferlog_std_format=YES
#
# You may change the default value for timing out an idle session.
#idle_session_timeout=600
#
# You may change the default value for timing out a data connection.
#data_connection_timeout=120
#
# It is recommended that you define on your system a unique user which the
# ftp server can use as a totally isolated and unprivileged user.
nopriv_user=http
#
# Enable this and the server will recognise asynchronous ABOR requests. Not
# recommended for security (the code is non-trivial). Not enabling it,
# however, may confuse older FTP clients.
#async_abor_enable=YES
#
# By default the server will pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to have the server actually do ASCII
# mangling on files when in ASCII mode.
# Beware that on some FTP servers, ASCII support allows a denial of service
# attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd
# predicted this attack and has always been safe, reporting the size of the
# raw file.
# ASCII mangling is a horrible feature of the protocol.
#ascii_upload_enable=YES
#ascii_download_enable=YES
#
# You may fully customise the login banner string:
ftpd_banner=Welcome to blah FTP service.
#
# You may specify a file of disallowed anonymous e-mail addresses. Apparently
# useful for combatting certain DoS attacks.
#deny_email_enable=YES
# (default follows)
#banned_email_file=/etc/vsftpd.banned_emails
#
# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
# (Warning! chroot'ing can be very dangerous. If using chroot, make sure that
# the user does not have write access to the top level directory within the
# chroot)
chroot_local_user=YES
#chroot_list_enable=YES
# (default follows)
#chroot_list_file=/etc/vsftpd.chroot_list
#
# You may activate the "-R" option to the builtin ls. This is disabled by
# default to avoid remote users being able to cause excessive I/O on large
# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
# the presence of the "-R" option, so there is a strong case for enabling it.
#ls_recurse_enable=YES
#
# When "listen" directive is enabled, vsftpd runs in standalone mode and
# listens on IPv4 sockets. This directive cannot be used in conjunction
# with the listen_ipv6 directive.
listen=YES
#
# This directive enables listening on IPv6 sockets. To listen on IPv4 and IPv6
# sockets, you must run two copies of vsftpd with two configuration files.
# Make sure, that one of the listen options is commented !!
#listen_ipv6=YES
pam_service_name=vsftpd
user_config_dir=/etc/vsftpd/users_conf
guest_enable=YES
guest_username=http
allow_writeable_chro
Voici le listing d'un répertoire avec mon client ftp :

Code : Tout sélectionner

Commande :	LIST
Réponse :	150 Here comes the directory listing.
Réponse :	226 Directory send OK.
Contenu :	drwxr-xr-x    3 33       33           4096 Sep 03 10:14 Config
Contenu :	drwxr-xr-x    4 33       33           4096 Sep 03 10:14 Console
Contenu :	drwxr-xr-x    3 33       33           4096 Sep 03 10:14 Controller
Contenu :	drwxr-xr-x    2 33       33           4096 Sep 03 10:14 Lib
Contenu :	drwxr-xr-x    3 33       33           4096 Sep 03 10:14 Locale
Contenu :	drwxr-xr-x    4 33       33           4096 Sep 03 10:14 Model
Contenu :	drwxr-xr-x    4 33       33           4096 Sep 03 10:14 Plugin
Contenu :	drwxr-xr-x    3 33       33           4096 Sep 03 10:14 Routing
Contenu :	drwxr-xr-x    4 33       33           4096 Sep 03 10:14 Test
Contenu :	drwxr-xr-x    2 33       33           4096 Sep 03 10:14 Vendor
Contenu :	drwxr-xr-x   20 33       33           4096 Sep 03 10:14 View
Contenu :	-rw-r--r--    1 33       33            714 Sep 03 10:14 index.php
Contenu :	drwxr-xr-x    6 33       33           4096 Sep 03 10:14 tmp
Contenu :	drwxr-xr-x    6 33       33           4096 Sep 03 10:14 webroot
Statut :	Contenu du dossier affiché avec succès
Merci pour votre lumière !
Avatar de l’utilisateur
benjarobin
Maître du Kyudo
Messages : 17235
Inscription : sam. 30 mai 2009, 15:48
Localisation : Lyon

Re: [vsftpd] Problème avec la date

Message par benjarobin »

C'est simple aucun serveur FTP ne retourne les secondes (enfin je crois)...
D'après les sources de Qt, les formats connus sont :

Code : Tout sélectionner

MMM dd yyyy
MMM dd hh:mm
MMM d yyyy
MMM d hh:mm
MMM d yyyy
MMM dd yyyy
MM-dd-yy  hh:mmAP
Sachant que

Code : Tout sélectionner

d	the day as number without a leading zero (1 to 31)
dd	the day as number with a leading zero (01 to 31)
MM	the month as number with a leading zero (01-12)
MMM	the abbreviated localized month name (e.g. 'Jan' to 'Dec').
yy	the year as two digit number (00-99)
yyyy	the year as four digit number

hh	the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)
mm	the minute with a leading zero (00 to 59)
AP  	interpret as an AM/PM time. AP must be either "AM" or "PM".
Zsh | KDE | PC fixe : core i7, carte nvidia
Titre d'un sujet : [Thème] Sujet (état) / Règles du forum
Avatar de l’utilisateur
Shingo
archer de cavalerie
Messages : 151
Inscription : dim. 03 févr. 2013, 19:06

Re: [vsftpd] Problème avec la date

Message par Shingo »

Merci pour ta réponse. Dans ce cas, comment est-ce possible que lorsque je me connecte au FTP de mon hébergeur, j'ai bien une date avec les secondes ?! En lisant les fichiers d'un répertoire, j'ai remarqué que ce n'était pas du tout le même format :

Code : Tout sélectionner

Réponse :	150 Opening ASCII mode data connection.
Contenu :	Type=cdir;Modify=20140904061333;Perm=cmpdfe;UNIX.mode=0750;UNIX.owner=2057169;UNIX.group=1100; .
Contenu :	Type=file;Size=311;Modify=20140720142344;Perm=adfrw;UNIX.mode=0644;UNIX.owner=2057169;UNIX.group=1101; .editorconfig
Contenu :	Type=file;Size=730;Modify=20140720142344;Perm=adfrw;UNIX.mode=0644;UNIX.owner=2057169;UNIX.group=1101; .gitattributes
Contenu :	Type=file;Size=333;Modify=20140720142344;Perm=adfrw;UNIX.mode=0644;UNIX.owner=2057169;UNIX.group=1101; .gitignore
Contenu :	Type=file;Size=304;Modify=20140807215835;Perm=adfrw;UNIX.mode=0644;UNIX.owner=2057169;UNIX.group=1101; .htaccess
Contenu :	Type=file;Size=547;Modify=20140720142345;Perm=adfrw;UNIX.mode=0644;UNIX.owner=2057169;UNIX.group=1101; .project
Contenu :	Type=dir;Modify=20140720142404;Perm=cmpdfe;UNIX.mode=0755;UNIX.owner=2057169;UNIX.group=1101; .settings
Contenu :	Type=file;Size=4037;Modify=20140720142345;Perm=adfrw;UNIX.mode=0644;UNIX.owner=2057169;UNIX.group=1101; .travis.yml
Contenu :	Type=file;Size=3252;Modify=20140720142350;Perm=adfrw;UNIX.mode=0644;UNIX.owner=2057169;UNIX.group=1101; CONTRIBUTING.md
Contenu :	Type=file;Size=1877;Modify=20140720142401;Perm=adfrw;UNIX.mode=0644;UNIX.owner=2057169;UNIX.group=1101; README.md
Contenu :	Type=dir;Modify=20140904071121;Perm=cmpdfe;UNIX.mode=0755;UNIX.owner=2057169;UNIX.group=1101; app
Contenu :	Type=file;Size=174;Modify=20140720142345;Perm=adfrw;UNIX.mode=0644;UNIX.owner=2057169;UNIX.group=1101; build.properties
Contenu :	Type=file;Size=10315;Modify=20140720142348;Perm=adfrw;UNIX.mode=0644;UNIX.owner=2057169;UNIX.group=1101; build.xml
Contenu :	Type=dir;Modify=20140729182755;Perm=cmpdfe;UNIX.mode=0750;UNIX.owner=2057169;UNIX.group=1101; cgi-data
Contenu :	Type=file;Size=705;Modify=20140720142349;Perm=adfrw;UNIX.mode=0644;UNIX.owner=2057169;UNIX.group=1101; composer.json
Contenu :	Type=file;Size=1454;Modify=20140720142400;Perm=adfrw;UNIX.mode=0644;UNIX.owner=2057169;UNIX.group=1101; index.php
Contenu :	Type=dir;Modify=20140727115547;Perm=cmpdfe;UNIX.mode=0755;UNIX.owner=2057169;UNIX.group=1101; lib
Contenu :	Type=file;Size=23;Modify=20140727122120;Perm=adfrw;UNIX.mode=0644;UNIX.owner=2057169;UNIX.group=1101; php.ini
Contenu :	Type=dir;Modify=20140720143842;Perm=cmpdfe;UNIX.mode=0755;UNIX.owner=2057169;UNIX.group=1101; plugins
Contenu :	Type=dir;Modify=20140720143843;Perm=cmpdfe;UNIX.mode=0755;UNIX.owner=2057169;UNIX.group=1101; vendors
J'obtiens le même type de résultat avec mon NAS qui tourne avec pureFTPD, peut-être que je devrais directement passer dessus ?!

edit : je suis parti sur quelques ftp qui tourne avec vsfpd comme ftp://ftp.redhat.com/redhat/, et j'ai remarqué que les secondes n'était pas prises en compte également. Alors peut-être que j'ai rencontré un faux problème. Le souci, c'est que les secondes me permettent d'uploader tout un dossier et demander à mon client d'écraser uniquement les fichiers les plus récents. Hors, comment mes modifications se font généralement en quelques secondes... Sinon au pire, je vais voir si mon IDE ne peut pas directement écrire sur le ftp...
Avatar de l’utilisateur
benjarobin
Maître du Kyudo
Messages : 17235
Inscription : sam. 30 mai 2009, 15:48
Localisation : Lyon

Re: [vsftpd] Problème avec la date

Message par benjarobin »

Je complète mon message précédent. En faite c'est bien ce qu'il me semblait il n'y a aucun standard voir http://stackoverflow.com/questions/4564 ... st-command
Sinon c'est la première fois que je vois ce format là.
Zsh | KDE | PC fixe : core i7, carte nvidia
Titre d'un sujet : [Thème] Sujet (état) / Règles du forum
Répondre