05.06.2013 Views

LINUX DEBIAN ETCH I servizi di rete

LINUX DEBIAN ETCH I servizi di rete

LINUX DEBIAN ETCH I servizi di rete

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Dott.Ing.Ivan Ferrazzi<br />

Tutti gli utenti virtuali utilizzeranno un utente e un gruppo creati apposta<br />

all'interno del sistema Linux. Come prima cosa dovremmo quin<strong>di</strong> creare il<br />

gruppo e l'utente come segue:<br />

groupadd ftpgroup<br />

useradd -g ftpgroup -d /dev/null -s /etc ftpuser<br />

Creiamo quin<strong>di</strong> il gruppo ftpgroup e <strong>di</strong> seguito l'utente ftpuser come<br />

utente del gruppo ftpgroup e senza home <strong>di</strong>rectory (-d /dev/null).<br />

Ora possiamo creare il primo utente virtuale che verrà poi utilizzato per<br />

gli effettivi collegamenti tramite client FTP:<br />

pure-pw useradd test1 -u ftpuser -d /home/ftpusers/test1<br />

Con questo comando creiamo l'utente virtuale test1 che verrà gestito<br />

dal sistema con i <strong>di</strong>ritti <strong>di</strong> ftpuser e avrà come home <strong>di</strong>rectory la cartella<br />

/home/ftpusers/test1. Nel caso in cui il demone pure-ftpd-wrapper<br />

fosse fatto partire con il parametro -j il sistema creerebbe la home<br />

<strong>di</strong>rectory automaticamente. Altrimenti dovremmo creare le cartelle<br />

manualmente.<br />

Creando le cartelle manualmente dobbiamo naturalmente fare attenzione<br />

all'utente proprietario della relativa cartella (ftpuser).<br />

Gli utenti creati verranno inseriti all'interno del file /etc/pureftpd/pureftpd.passwd.<br />

Questo file non viene però letto <strong>di</strong>rettamente<br />

dal demone in esecuzione. Per questo motivo <strong>di</strong>venta in<strong>di</strong>spensabile<br />

eseguire il comando<br />

pure-pw mkdb<br />

che creerà il file /etc/pure-ftpd/pureftpd.pdb, un file binario che verrà<br />

letto <strong>di</strong>rettamente dal demone in questione. E' importantissimo, quin<strong>di</strong>,<br />

ricordarsi <strong>di</strong> eseguire questo comando ogni volta si vada a mo<strong>di</strong>ficare il<br />

file pureftpd.passwd.<br />

Per mo<strong>di</strong>ficare la password <strong>di</strong> un utente già esistente basta <strong>di</strong>gitare<br />

pure-pw passwd test1<br />

oppure<br />

pure-pw userdel test1<br />

per eliminare l'utente dal <strong>servizi</strong>o.<br />

Anche dopo queste operazioni va eseguito il pure-pw mkdb.<br />

L'ultimo passaggio che dobbiamo ricordarci <strong>di</strong> fare è <strong>di</strong> attivare la relativa<br />

gestione dei permessi. All'interno della cartella /etc/pure-ftpd/conf<br />

14/17

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!