View previous topic :: View next topic |
Author |
Message |
abaddon83 Guru
Joined: 17 Jan 2004 Posts: 494
|
Posted: Tue Apr 12, 2005 10:02 pm Post subject: [OT] scriptino cgi in bash |
|
|
scusate il tremendo ot, ma mi sono inchiodato allegramente e non so come venirne a capo
il mio progblema è il seguente:
sto creando uno scriptino cgi-bin che mi permetta di creare utenti ftp (server ftp pure-ftpd) tramite form html.
il form manda i dati allo script e lo script lo esegue, gli unici dati che mi interessano sono username e password e il problema nasce ora, il comando per creare un utente nel demone ftpd è il seguente:
Code: | [...]
pure-pw useradd ${QUERY[1]} -u ftpuser -d /home/ftp/${QUERY[1]}
[...]
|
dove ${QUERY[1]} indica il nome dell'utente e anche il nome della dir, il problema è che pure-pw useradd dopo essere stato eseguito richiede di inserire la pass 2 volte che sarebbe: ${QUERY[2]} come faccio a inserirla?
come faccio a far capire allo script che quando eseguo pure-pw appena esce la scritta Password deve inserire il valore di ${QUERY[2]}?
scusate ancora l'ot, ma mi sto tirando matto _________________ Abaddon's House
Jabber account: abaddon@jabber.linux.it |
|
Back to top |
|
|
oRDeX Veteran
Joined: 19 Oct 2003 Posts: 1325 Location: Italy
|
Posted: Tue Apr 12, 2005 10:22 pm Post subject: |
|
|
eh..bel problema...pure-pw non ha un'opzione da passargli da riga di comando per la pass? |
|
Back to top |
|
|
abaddon83 Guru
Joined: 17 Jan 2004 Posts: 494
|
Posted: Tue Apr 12, 2005 10:33 pm Post subject: |
|
|
questo è l'help, a me non sembra pero' potrei sbagliarmi...
Quote: | pure-pw useradd <login> [-f <passwd file>] -u <uid> [-g <gid>]
-D/-d <home directory> [-c <gecos>]
[-t <download bandwidth>] [-T <upload bandwidth>]
[-n <max number of files>] [-N <max Mbytes>]
[-q <upload ratio>] [-Q <download ratio>]
[-r <allow client ip>/<mask>] [-R <deny client ip>/<mask>]
[-i <allow local ip>/<mask>] [-I <deny local ip>/<mask>]
[-y <max number of concurrent sessions>]
[-z <hhmm>-<hhmm>] [-m]
pure-pw usermod <login> -f <passwd file> -u <uid> [-g <gid>]
-D/-d <home directory> -[c <gecos>]
[-t <download bandwidth>] [-T <upload bandwidth>]
[-n <max number of files>] [-N <max Mbytes>]
[-q <upload ratio>] [-Q <download ratio>]
[-r <allow client ip>/<mask>] [-R <deny client ip>/<mask>]
[-i <allow local ip>/<mask>] [-I <deny local ip>/<mask>]
[-y <max number of concurrent sessions>]
[-z <hhmm>-<hhmm>] [-m]
pure-pw userdel <login> [-f <passwd file>] [-m]
pure-pw passwd <login> [-f <passwd file>] [-m]
pure-pw show <login> [-f <passwd file>]
pure-pw mkdb [<puredb database file> [-f <passwd file>]]
pure-pw list [-f <passwd file>]
-d <home directory> : chroot user (recommended)
-D <home directory> : don't chroot user
-<option> '' : set this option to unlimited
-m : also update the /etc/pureftpd.pdb database
For a 1:10 ratio, use -q 1 -Q 10
To allow access only between 9 am and 6 pm, use -z 0900-1800
|
_________________ Abaddon's House
Jabber account: abaddon@jabber.linux.it |
|
Back to top |
|
|
Dhaki Guru
Joined: 16 Jun 2004 Posts: 325 Location: Ticino - CH
|
|
Back to top |
|
|
abaddon83 Guru
Joined: 17 Jan 2004 Posts: 494
|
Posted: Wed Apr 13, 2005 7:08 am Post subject: |
|
|
grazie! sembra che sia proprio quello che interessa a me dopo lo provo, ora devo studiare -.- uff _________________ Abaddon's House
Jabber account: abaddon@jabber.linux.it |
|
Back to top |
|
|
|