4 069
contributi
Riga 333: | Riga 333: | ||
== FTP anonimo == | == FTP anonimo == | ||
E' possibile creare anche un account ftp anonimo, cioè un account ftp che chiunque possa usare senza una password, in questo modo. | |||
<br/> | |||
Creiamo innanzitutto un utente, un gruppo di sistema e una home directory: | |||
<pre> | |||
# mkdir /var/www/anonymous_ftp | |||
# groupadd -g 2002 anonymous_ftp | |||
# useradd -u 2002 -s /bin/false -d /var/www/anonymous_ftp -m -c "Anonymous FTP User" -g anonymous_ftp anonymous_ftp | |||
</pre> | |||
Poi creiamo la directory <code>/home/anonymous_ftp/incoming</code> dove gli utenti anonimi potranno caricare i file: | |||
<pre> | |||
# mkdir /var/www/anonymous_ftp/incoming | |||
# chown anonymous_ftp:nogroup /var/www/anonymous_ftp/incoming | |||
</pre> | |||
Infine apriamo il file di configurazione <code>/etc/proftpd/proftpd.conf</code> e aggiungiamo le direttive: | |||
<pre> | |||
vi /etc/proftpd/proftpd.conf | |||
</pre> | |||
<pre> | |||
[...] | |||
<Anonymous /var/www/anonymous_ftp> | |||
User anonymous_ftp | |||
Group nogroup | |||
# We want clients to be able to login with "anonymous" as well as "ftp" | |||
UserAlias anonymous anonymous_ftp | |||
# Cosmetic changes, all files belongs to ftp user | |||
DirFakeUser on anonymous_ftp | |||
DirFakeGroup on anonymous_ftp | |||
RequireValidShell off | |||
# Limit the maximum number of anonymous logins | |||
MaxClients 10 | |||
# We want 'welcome.msg' displayed at login, and '.message' displayed | |||
# in each newly chdired directory. | |||
DisplayLogin welcome.msg | |||
DisplayChdir .message | |||
# Limit WRITE everywhere in the anonymous chroot | |||
<Directory *> | |||
<Limit WRITE> | |||
DenyAll | |||
</Limit> | |||
</Directory> | |||
# Uncomment this if you're brave. | |||
<Directory incoming> | |||
# Umask 022 is a good standard umask to prevent new files and dirs | |||
# (second parm) from being group and world writable. | |||
Umask 022 022 | |||
<Limit READ WRITE> | |||
DenyAll | |||
</Limit> | |||
<Limit STOR> | |||
AllowAll | |||
</Limit> | |||
</Directory> | |||
</Anonymous> | |||
</pre> | |||
Riavviamo il servizio: | |||
<pre> | |||
/etc/init.d/proftpd restart | |||
</pre> | |||
e verifichiamo che gli utenti anonimi possano ora effettuare il login. | |||
<br/> | |||
L'impostazione data prevede che gli utenti anonimi possano: | |||
* scaricare i file messi in /var/www/anonymous_ftp | |||
* caricare i file nella directory /var/www/anonymous_ftp/incoming | |||
Una volta che un file è stato caricato, nessuno può leggerlo o scaricarlo prima che un amministratore lo sposti nella directory /var/www/anonymous_ftp per renderlo disponibile a tutti. | |||
<br/><br/> | |||
--[[Utente:Ferdybassi|Ferdybassi]] 19:40, 8 nov 2010 (CET) | |||
[[Categoria:]] |