|
|
|
![]() |
|
Strumenti |
![]() |
#1 |
Senior Member
Iscritto dal: Dec 2004
Città: Roma
Messaggi: 571
|
configurazione vsftp
Sto diventando matto...tutto cio' che voglio fare è creare 2 utenti, impostare nome utente e password e permettere a loro (e solo a loro) dopo aver inserito user id e password di accedere, scaricare e uploadare file e cartelle ognuno in un'unica cartella scelta da me senza che abbiano i privilegi per accedere al resto del sistema, se possibile vorrei che lo scambio di dati tra me e tali utenti fosse criptato. Insomma un sistema come quello che si puo' creare con flezilla su windows!
Ho visto parecchi how to sulla configurazione di vsftpd ma mi pare che si parli solo di utenti anonimi e locali!!!! Questo è il mio file di configurazione: # 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. # # # Run standalone? vsftpd can run either from an inetd or as a standalone # daemon started from an initscript. listen=YES # # Run standalone with IPv6? # Like the listen parameter, except vsftpd will listen on an IPv6 socket # instead of an IPv4 one. This parameter and the listen parameter are mutually # exclusive. #listen_ipv6=YES # # Allow anonymous FTP? (Beware - allowed by default if you comment this out). anonymous_enable=YES # # 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 #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=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=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 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(). #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 # # # Debian customization # # Some of vsftpd's settings don't fit the Debian filesystem layout by # default. These settings are more Debian-friendly. # # 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 # # 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 # # This option specifies the location of the RSA key to use for SSL # encrypted connections. rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key Spero possiate dirmi che cosa modificare per ottenere l'effetto voluto!Le cartelle che voglio mettere a disposizione degli utenti sono nella cartella FTP creata nella mia home!siete la mia unica speranza!!!Ogni consiglio è ben accetto!!!! ![]() ![]() |
![]() |
![]() |
![]() |
#2 |
Member
Iscritto dal: Oct 2006
Messaggi: 109
|
ciao gabasr581,
devi configurare il server impostando gli utenti virtuali, un tempo mi ero aiutato con un'howto trovato su internet però non ricordo dove. ho trovato soltanto un README.txt sul mio pc che indica : "This example shows how to set up vsftpd / PAM with "virtual users". A virtual user is a user login which does not exist as a real login on the system. Virtual users can therefore be more secure than real users, beacuse a compromised account can only use the FTP server." ![]()
__________________
bem@bemdeb:~$ uname -a Linux bemprt 2.6.32-5-686 #1 SMP Tue Jun 1 04:59:47 UTC 2010 i686 GNU/Linux |
![]() |
![]() |
![]() |
#3 | |
Senior Member
Iscritto dal: Sep 2004
Città: Vicenza
Messaggi: 474
|
Quote:
__________________
Il mio blog |
|
![]() |
![]() |
![]() |
#4 |
Senior Member
Iscritto dal: Dec 2004
Città: Roma
Messaggi: 571
|
Intanto grazie per le risposte e... per la guida!!!!!!!!E' proprio quello che ci voleva!
Pero'...sto seguendo l'how to passo passo, ho creato il database con utenti e password l'ho copiato in /etc/pam.d, ho creato l'utente ftpuser e gli ho assegnato come Home la cartella /home/ftp...poi mi sono accorto che: 1)Nonostante nel menu Administration - Users and Groups la cartella /home/ftp risulti la Home dell user ftpuser, se ci clicco col tasto destro e vado in permission , l'owner risulta ancora essere 'root'...è normale? 2)Nel mio file di configurazione (quello riportato nel post precedente) mancano alcune delle opzioni riportate nella tua guida, tra cui, credo, quella per attivare i guests!!! Consigli? |
![]() |
![]() |
![]() |
#5 |
Senior Member
Iscritto dal: Dec 2004
Città: Roma
Messaggi: 571
|
Buongiorno a tutti!Dopo qualche peripezia e grazie all'aiuto vostro e dia altri, sono riuscito quasi a far funzionare vsftpd...il quasi è dovuto al fatto che, mentre x l'download non ci sono problemi, l'upload di file e cartelle risulta impossibile!!!nel mio file di configurazione, ho permesso solo gli accessi anonimi con una password scelta da me e ho dato loro tuti i permessi (write_enable; mkdir; upload)...dove sbaglio?devo forse cambiare anche i permessi della cartella condivisa che vsftpd mi ha creato (home/vsftpd)...in attesa di un aiuto vi auguro una splendida giornata!!! Cool
Questo è il mio conf: # 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. # # # Run standalone? vsftpd can run either from an inetd or as a standalone # daemon started from an initscript. listen=YES # # Run standalone with IPv6? # Like the listen parameter, except vsftpd will listen on an IPv6 socket # instead of an IPv4 one. This parameter and the listen parameter are mutually # exclusive. #listen_ipv6=YES # # Allow anonymous FTP? (Beware - allowed by default if you comment this out). anonymous_enable=YES # # 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=carcarlo # # 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 #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=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=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 gabriele 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 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(). #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 # # # Debian customization # # Some of vsftpd's settings don't fit the Debian filesystem layout by # default. These settings are more Debian-friendly. # # 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 # # 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 # # This option specifies the location of the RSA key to use for SSL # encrypted connections. rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key # # Set to YES if you want only a specified list of e-mail passwords # for anonymous logins to be accepted. This is useful as a low- # hassle way of restricting access to low-security content without # needing virtual users. When enabled, anonymous logins are pre‐ # vented unless the password provided is listed in the file speci‐ # fied by the email_password_file setting. The file format is one # password per line, no extra whitespace. The default filename is # /etc/vsftpd.email_passwords. secure_email_list_enable=YES # # If vsftpd is in standalone mode, this is the maximum number of # clients which may be connected. Any additional clients connect‐ # ing will get an error message. max_clients=2 |
![]() |
![]() |
![]() |
#6 | |
Senior Member
Iscritto dal: Sep 2004
Città: Vicenza
Messaggi: 474
|
Certo, vanno cambiati anche i permessi della cartella: è il punto 11 della mia guida.
Quote:
![]()
__________________
Il mio blog |
|
![]() |
![]() |
![]() |
#7 |
Senior Member
Iscritto dal: Dec 2004
Città: Roma
Messaggi: 571
|
grazie ancora e perdona l'ignoranza...quando ho installato vsftpd alla fine il programma mi ha detto di aver creato un utente ftp appartenente al gruppo "nogroups" e che "NOT creating" la cartella /home/ftp (che invece ha creato)...ora ho 3 domande:
1)dov'è l'utente ftp, visto che tra gla lista degli utenti non lo trovo malgrado esista? 2)La cartella /home/ftp è la home dell' utente ftp anche se appartiene a root? 3)Puoi dirmi di preciso come devo cambiare i permessi per permettere l'upload? Grazie!!! |
![]() |
![]() |
![]() |
#8 |
Senior Member
Iscritto dal: Sep 2004
Città: Vicenza
Messaggi: 474
|
1) Ti riporto il punto dove viene definito l'utente:
9. Dichiariamo dove sarà la cartella dove andranno ad accedere gli utenti e creiamo un utente chiamato ‘ftpuser’: useradd -d /var/ftp ftpuser ls -ld /var/ftp L'utente in questo caso si chiama 'ftpuser' e lo trovi sotto gli utenti del sistema. 2) Si. 3) Per le autorizzazioni a livello di cartella basta fare clic destro sulla cartella e impostare come gruppo di appartenenza 'users'
__________________
Il mio blog |
![]() |
![]() |
![]() |
#9 |
Senior Member
Iscritto dal: Dec 2004
Città: Roma
Messaggi: 571
|
mmm...se faccio destro>cartella>Permessi mi dice che la cartella è del "root" e il gruppo è "nogroup"...non posso cambiare nulla perchè non ho i permessi necessari...non dovrei farlo loggandomi da root tipo con "sudo chmod..."?Se si, che tipo di "chmod" dovrei dare?
|
![]() |
![]() |
![]() |
#10 |
Senior Member
Iscritto dal: Sep 2004
Città: Vicenza
Messaggi: 474
|
Si hai ragione, lo devi fare da root. Io mi sono sempre loggato come root (uso ubuntu) e ho cambiato le autorizzazioni.
__________________
Il mio blog |
![]() |
![]() |
![]() |
#11 |
Senior Member
Iscritto dal: May 2002
Messaggi: 4528
|
Lo so, non è il max della sicurezza, ma io mi logo semplicemente con utente e psw del pc che fa da server ftp e posso prendere, eliminare e modificare come l'utente stesso. Mi serviva poter accedere in varie partizioni di dischi e su dischi esterni e questa mi è sembrata la miglior soluzione. Non faccio ftp su web, quindi.....
Ciauz!!
__________________
Dell e6400 + Asus nexus 7 + galaxy s2 |
![]() |
![]() |
![]() |
#12 |
Senior Member
Iscritto dal: Dec 2004
Città: Roma
Messaggi: 571
|
allora...dopo vari esperimenti, ho deciso didare un sudochmod 777 /home/ftp...ora la cartella appare ancora proprietà del root, ma io (loggandomi come utente normale) posso farci cio' che voglio...ora non mi resta che vedere (domani) se i due utenti che dovranno connettersi al server riescono ad uploadare file e cartelle...spero di non aver compromesso troppo la sicurezza cos' facendo!In fondo se qualche malintenzionato riuscisse a sfruttare il server ftp per fare casino nel pc, teoricamente, potrebbesoltanto muoversi all'interno della cartella /home/ftp...giusto?
|
![]() |
![]() |
![]() |
#13 |
Senior Member
Iscritto dal: Sep 2004
Città: Vicenza
Messaggi: 474
|
Teoricamente si!
![]()
__________________
Il mio blog |
![]() |
![]() |
![]() |
#14 |
Senior Member
Iscritto dal: Dec 1999
Città: Pavia
Messaggi: 662
|
La butto li ....
Poi per quanto riguarda vsftp: In /etc/vsftpd.ftpusers aggiungi tutti gli utenti che non vuoi accedano ad ftp In /etc/vsftpd.conf:
Ultima modifica di Ciccio75 : 31-01-2007 alle 13:44. |
![]() |
![]() |
![]() |
#15 | |
Senior Member
Iscritto dal: Sep 2004
Città: Vicenza
Messaggi: 474
|
Quote:
__________________
Il mio blog |
|
![]() |
![]() |
![]() |
#16 |
Senior Member
Iscritto dal: Dec 1999
Città: Pavia
Messaggi: 662
|
Beh la home è chrotttata e la shell degli utenti non esiste .... la vedo difficile !!
Tutto è possibile comunque ...... ![]() |
![]() |
![]() |
![]() |
#17 |
Senior Member
Iscritto dal: Dec 2004
Città: Roma
Messaggi: 571
|
giusto un aggiornamento...con chmod 777 i client non riescono piu' a connettersi, si blocca tuto al momento della lettura delle directory...misteri...domani riprovo, altrimenti faccio una copia di vsftpd.conf e reinstall vsftpd...che pizza!!!!!
|
![]() |
![]() |
![]() |
#18 |
Senior Member
Iscritto dal: Sep 2004
Città: puɐlɹǝpuoʍ
Messaggi: 1710
|
Riporto a galla la discussione...
Vorrei capire quanto sia necessario, in una rete locale casalinga che sta dietro a un router, utilizzare gli utenti virtuali... Perchè se ho capito bene in questo modo dovrei far girare anche un database o sbaglio? Preferirei invece occupare il minor numero di risorse possibile... |
![]() |
![]() |
![]() |
#19 |
Member
Iscritto dal: May 2008
Messaggi: 262
|
Ciao
approfitto di questa discussione anche se datata per chiedere aiuto nella configurazione di vsftpd. Lo scopo è lo stesso di 'gabasr' cioè creare 2 o + utenti, impostare nome utente e password e permettere solo a loro dopo aver inserito user id e psw di accedere, scaricare e uploadare file e cartelle ognuno in un'unica cartella scelta da me senza che abbiano i privilegi per accedere al resto del sistema. Ho seguito una guida trovata su internet ma ad un certo punto dopo aver inviato un comando mi da errore. Ho provato a cercare una soluzione ma non tutti seguono quella linea e alla fine non so cosa fare.... Sono una principiante in questo mondo. Dato questo comando: sudo useradd -c "Utente FTP" -g ftp-users -m -k /dev/null -s /bin/false -d /var/ftp/utenteftp utenteftp ---impossibile creare la directory /var/ftp/utenteftp In precedenza ho creato il gruppo ftp-users ed inoltre è presente un file con la lista degli utenti ftp abilitati. Dove sbaglio? Grazie ![]() Ultima modifica di Lupalbe : 21-01-2014 alle 10:42. |
![]() |
![]() |
![]() |
#20 | |
Senior Member
Iscritto dal: Feb 2002
Messaggi: 2511
|
Quote:
Prova a spiegare: a che punto di quale configurazione eri arrivato che comando hai dato che errore hai ricevuto. |
|
![]() |
![]() |
![]() |
Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 16:16.