Création d'un espace FTP et de l'utilisateur

Bonsoir,

Comme dis dans le titre je souhaite créer un espace FTP et son utilisateur

seulement j’ai un message Utlisation avec les explications de chaque lettre

ex : [quote]-d, --home-dir REP_PERS répertoire personnel pour le compte du nouvel utilisateur[/quote] etc…

Lorsque je tape :

La réponse est :

Où ais-je commis l’erreur.

D’avance merci

Il faudrait peut-être indiquer à [mono]useradd[/mono] le login de l’utilisateur à créer. Là tu n’indiques que le répertoire utilisateur.

Bonjour matinal,

Tout d’abord merci Pascal, cela fonctionne beaucoup mieux effectivement !!!

Cependant…

vérification et création du répertoire :

droits d’accès

Vérification :

Mais au test de la configuration de VSFTPD via FZ

Hôte : adresse ip du serveur
Port vide
Protocole : FTP - protocole de transfert de fichiers
Chiffrement : connexion FTP simple (non sécurisée)
Type d’authentification : normale
Identifiant : le nom de l’utilisateur
MP : xxxxxxxxxx

Puis connexion

Message d’erreur

Cela signifie sans doute qu’il manque des droits et si oui lesquels car mes recherches, pour l’instant, n’ont rien donnée.

Ou sinon une autre piste

D’avance merci

Pas tout compris de ta vérification et création du répertoire.

Le message d’erreur “connexion refusée” signifie plutôt que le port destination (21 par défaut pour FTP) n’est pas ouvert en écoute. Le service FTP est-il bien actif ?

[quote]Pas tout compris de ta vérification et création du répertoire.
[/quote]

Je suis loin d’être toujours tès clair…

Lorsque j’ai vérifié si le répétoire était créé :

Il ne l’était pas

Alors les commandes mkdir… et chmod… m’ont permis de le créer

[quote]Le message d’erreur “connexion refusée” signifie plutôt que le port destination (21 par défaut pour FTP) n’est pas ouvert en écoute. Le service FTP est-il bien actif ?
[/quote]

Pour l’instant aucune règles Iptable… mais cela ne va tarder. Heureusement il y a beaucoup de posts sur le sujet dernierement sur ce même forum.

[quote]Proto Recv-Q Send-Q Adresse locale Adresse distante Etat
tcp 0 0 localhost:mysql : LISTEN
tcp 0 0 :sunrpc : LISTEN
tcp 0 0 :ssh : LISTEN
tcp 0 0 localhost:ipp : LISTEN
tcp 0 0 localhost:smtp : LISTEN
tcp 0 0 :43007 : LISTEN
tcp6 0 0 [::]:58377 [::]:
LISTEN
tcp6 0 0 [::]:sunrpc [::]:
LISTEN
tcp6 0 0 [::]:http [::]:
LISTEN
tcp6 0 0 [::]:ssh [::]:* LISTEN
tcp6 0 0 localhost:ipp [::]:* LISTEN
tcp6 0 0 localhost:smtp [::]:* LISTEN
udp 0 0 *:983 :
udp 0 0 localhost:1015 :
udp 0 0 :52800 :
udp 0 0 :bootpc :
udp 0 0 :33350 :
udp 0 0 :sunrpc :
udp 0 0 :ipp :
udp 0 0 :42677 :
udp 0 0 :mdns :
udp6 0 0 [::]:983 [::]:

udp6 0 0 [::]:50791 [::]:

udp6 0 0 [::]:sunrpc [::]:

udp6 0 0 [::]:45694 [::]:

udp6 0 0 [::]:mdns [::]:

udp6 0 0 [::]:10123 [::]:

raw6 0 0 [::]:ipv6-icmp [::]:
7
Sockets du domaine UNIX actives(seulement serveurs)
Proto RefCnt Flags Type State I-Node Chemin
unix 2 [ ACC ] STREAM LISTENING 17892 /tmp/ksocket-secondnouveau/kio_http_cache_cleaner
unix 2 [ ACC ] STREAM LISTENING 15174 @/tmp/dbus-QafFRXSPv4
unix 2 [ ACC ] STREAM LISTENING 15121 /run/user/1000/systemd/private
unix 2 [ ACC ] STREAM LISTENING 15561 @/tmp/.ICE-unix/1535
unix 2 [ ACC ] STREAM LISTENING 13629 @/tmp/.X11-unix/X0
unix 2 [ ACC ] STREAM LISTENING 13358 /var/run/NetworkManager/private
unix 2 [ ACC ] STREAM LISTENING 14385 /var/run/mysqld/mysqld.sock
unix 2 [ ACC ] STREAM LISTENING 8015 /run/systemd/private
unix 2 [ ACC ] STREAM LISTENING 10580 /run/rpcbind.sock
unix 2 [ ACC ] STREAM LISTENING 8039 /run/lvm/lvmetad.socket
unix 2 [ ACC ] SEQPACKET LISTENING 8042 /run/udev/control
unix 2 [ ACC ] STREAM LISTENING 13420 /var/run/NetworkManager/private-dhcp
unix 2 [ ACC ] STREAM LISTENING 8045 /run/systemd/journal/stdout
unix 2 [ ACC ] STREAM LISTENING 14200 /var/run/xdmctl/dmctl-:0/socket
unix 2 [ ACC ] STREAM LISTENING 11127 /var/run/avahi-daemon/socket
unix 2 [ ACC ] STREAM LISTENING 11130 /var/run/dbus/system_bus_socket
unix 2 [ ACC ] STREAM LISTENING 11133 /var/run/cups/cups.sock
unix 2 [ ACC ] STREAM LISTENING 11136 /run/acpid.socket
unix 2 [ ACC ] STREAM LISTENING 16059 /run/user/1000/pulse/native
unix 2 [ ACC ] STREAM LISTENING 13630 /tmp/.X11-unix/X0
unix 2 [ ACC ] STREAM LISTENING 15160 /tmp/ssh-HyJV2u4GlfIm/agent.1430
unix 2 [ ACC ] STREAM LISTENING 15261 /tmp/ksocket-secondnouveau/kdeinit4__0
unix 2 [ ACC ] STREAM LISTENING 15272 /tmp/ksocket-secondnouveau/klauncherMT1508.slave-socket
unix 2 [ ACC ] STREAM LISTENING 15562 /tmp/.ICE-unix/1535
unix 2 [ ACC ] STREAM LISTENING 13566 /var/run/xdmctl/dmctl/socket[/code]

Est-ce la bonne commande pour vérifier

Car je suis loin de pouvoir tout interpreter !!!

[mono]netstat -tnl[/mono] aurait affiché uniquement les sockets TCP en écoute (puisque FTP utilise TCP) et les adresses et ports sous forme numérique. Mais l’important est qu’on ne voit pas de socket en écoute sur le port 21, donc le serveur FTP (vsftpd ?) ne tourne pas. Peut-être une erreur de configuration ?

Alors effectivement

donne

[quote]Connexions Internet actives (seulement serveurs)
Proto Recv-Q Send-Q Adresse locale Adresse distante Etat
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:43007 0.0.0.0:* LISTEN
tcp6 0 0 :::58377 :::* LISTEN
tcp6 0 0 :::111 :::* LISTEN
tcp6 0 0 :::80 :::* LISTEN
tcp6 0 0 :::22 :::* LISTEN
tcp6 0 0 ::1:631 :::* LISTEN
tcp6 0 0 ::1:25 :::* LISTEN [/quote]

J’ai bien essayé une connexion avec le port 22, mais c’est enore pire au niveau du message d’erreur

Si on parle bien de la même chose… voilà ma configuartion VSFTPD

[quote] /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.

Run standalone? vsftpd can run either from an inetd or as a standalone

daemon started from an initscript.

listen=YES

This directive enables listening on IPv6 sockets. By default, listening

on the IPv6 “any” address (::slight_smile: will accept connections from both IPv6

and IPv4 clients. It is not necessary to listen on both IPv4 and IPv6

sockets. If you want that (perhaps because you want to listen on specific

addresses) then you must run two copies of vsftpd with two configuration

files.

listen_ipv6=YES

Allow anonymous FTP? (Disabled by default).

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=NO

Uncomment this if you want the anonymous FTP user to be able to create

new directories.

#anon_mkdir_write_enable=NO

Activate directory messages - messages given to remote users when they

go into a certain directory.

dirmessage_enable=YES
If enabled, vsftpd will display directory listings with the time

in your local time zone. The default is to display GMT. The

times returned by the MDTM FTP command are also affected by this

option.

use_localtime=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=300

You may change the default value for timing out a data connection.

#data_connection_timeout=120

#connect_timeout=60

#accept_timeout=60

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=ftpsecure

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=NO

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=NO
#ascii_download_enable=NO

You may fully customise the login banner string:

#ftpd_banner=Soyez les bienvenue sur ce serveur!!

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 restrict local users to their home directories. See the FAQ for

the possible risks in this before using chroot_local_user or

chroot_list_enable below.

#chroot_local_user=YES

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_local_user=NO
#chroot_list_enable=NO

(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

Customization

Some of vsftpd’s settings don’t fit the filesystem layout by

default.

This option should be the name of a directory which is empty. Also, the

directory should not be writable by the ftp user. This directory is used

as a secure chroot() jail at times vsftpd does not require filesystem

access.

secure_chroot_dir=/var/run/vsftpd/empty

This string is the name of the PAM service vsftpd will use.

pam_service_name=vsftpd

This option specifies the location of the RSA certificate to use for SSL

encrypted connections.

rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
ssl_enable=NO
[/quote]

Je ne vois null part Port 21…

C’est sans doute de là que viens l’erreur

21 est le port standard pour FTP, pas besoin de le spécifier.
As-tu essayé de redémarrer vsftpd pour voir ce qui se passe ?

restart vsftpd OK

Mais toujours pas de connexion possible

Bon c’est peut être un mal pour un bien.

Installation SSH, bon là on est en port 22 et j’espère que tout fonctionnera.

Merci pour le temps passé et la qualité des réponses, comme d’habitude.

Même erreur ? Vérifie si un processus vsftpd est bien présent avec [mono]ps -Af[/mono]. Si oui, regarde sur quel port il écoute avec [mono]netstat -nltp[/mono] (en root).

Oui

rien vue qui ressemble avec vsftpd (cela voudrait dire que l’installation c’est mal passée)

Confirmation avec :

netstat -nltp en root

[quote]Proto Recv-Q Send-Q Adresse locale Adresse distante Etat PID/Program name
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 970/mysqld
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 404/rpcbind
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 439/sshd
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 489/cupsd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1383/exim4
tcp 0 0 0.0.0.0:43007 0.0.0.0:* LISTEN 415/rpc.statd
tcp6 0 0 :::58377 :::* LISTEN 415/rpc.statd
tcp6 0 0 :::111 :::* LISTEN 404/rpcbind
tcp6 0 0 :::80 :::* LISTEN 3198/apache2
tcp6 0 0 :::22 :::* LISTEN 439/sshd
tcp6 0 0 ::1:631 :::* LISTEN 489/cupsd
tcp6 0 0 ::1:25 :::* LISTEN 1383/exim4
[/quote]

Lorsque j’ai installeé VSTFPD 3 paquets installés et 13… je ne me rapelle plus le message exact… j’aurais peutêtre du commencer par là !!!

Comment relances-tu vsftpd ?
Tu peux vérifier le statut d’installation du paquet avec

Réponse

[quote][ ok ] Restarting vsftpd (via systemctl): vsftpd.service.
[/quote]

et

donne

[quote]Package: vsftpd
Status: install ok installed
Priority: extra
Section: net
Installed-Size: 311
Maintainer: Jörg Frings-Fürst debian@jff-webhosting.net
Architecture: i386
Version: 3.0.2-17
Replaces: ftp-server
Provides: ftp-server
Depends: debconf (>= 0.5) | debconf-2.0, init-system-helpers (>= 1.18~), libc6 (>= 2.15), libcap2 (>= 1:2.10), libpam0g (>= 0.99.7.1), libssl1.0.0 (>= 1.0.0), libwrap0 (>= 7.6-4~), adduser, dialog, libpam-modules, netbase
Recommends: logrotate, ssl-cert
Conflicts: ftp-server
Conffiles:
/etc/pam.d/vsftpd e75200b7896d8b2c2f2590d0e3d4a6ef
/etc/logrotate.d/vsftpd dac2cb7b9cfd8a03b4fa9ca3601a43a6
/etc/init.d/vsftpd 928df246db348b3be4daeecfe535cd66
/etc/ftpusers 839f3157aad792bafbbdcd932a95a345
/etc/vsftpd.conf bb230d6da3767b1371108885739d4e0e
Description: lightweight, efficient FTP server written for security
This package provides the “Very Secure FTP Daemon”, written from
the ground up with security in mind.
.
It supports both anonymous and non-anonymous FTP access, PAM authentication,
bandwidth limiting, and the Linux sendfile() facility.
Homepage: vsftpd.beasts.org/
[/quote]