- Crea una nuova Jail in modo da non sporcare il sistema di base (puoi farlo via SSH usando iocage create o via GUI)
- Via SSH, dopo essere entrato (con jexec <id> tcsh) nella jail appena creata crea l’utente utilizzando adduser e aggiungilo al gruppo ftp
root@FTPServer:/ # adduser
Username: testUser
Full name: Utente di prova
Uid (Leave empty for default):
Login group [testUser]:
Login group is testUser. Invite testUser into other groups? []: ftp
Login class [default]:
Shell (sh csh tcsh nologin) [sh]: sh
Home directory [/home/testUser]:
Home directory permissions (Leave empty for default):
Use password-based authentication? [yes]:
Use an empty password? (yes/no) [no]:
Use a random password? (yes/no) [no]: yes
Lock out the account after creation? [no]:
Username : testUser
Password : <random>
Full Name : Utente di prova
Uid : 1002
Class :
Groups : testUser ftp
Home : /home/testUser
Home Mode :
Shell : /bin/sh
Locked : no
OK? (yes/no): yes
- Per evitare che l’utente creato possa navigare oltre la sua home, crea /etc/ftpchroot e inserisci il nome dell’utente appena creato
root@FTPServer:/ # cd etc
root@FTPServer:/etc # touch ftpchroot
root@FTPServer:/etc # vi ftpchroot
- Ripeti le operazioni 2 e 3 per ogni utente che vuoi creare
- Inserisci in /etc/rc.conf l’impostazione ftpd_enable=”YES”
- Dai service ftpd start via SSH
root@FTPServer:/etc # service ftpd start
Starting ftpd.
Ovviamente dovrai assegnare un mountpoint esistente sul tuo pool di FreeNAS e collegarlo ad /home/testUser interno alla jail.
Emanuele