Hi, Mário Gamito wrote:
I have this command to create an FTP account: # pure-pw useradd mario -u 502 -g 502 -n 1000 -N 200 -d /home/pages/gamito This command asks for the password twice.
It's a shame it doesn't allow you to pass in a password on the command line, like the UNIX useradd command, but hey ho.
I wouldn't bother using the pure-pw command, and would modify the /etc/pureftpd.passwd file manually. I had a quick look at the documentation and it seems you have to make sure you rebuild the passwd database to commit any changes with:
pure-pw mkdbif you manually edit it. There is a description of the passwd file format in the documentation. Here is an extract:
--------------------------------------------------------- You can also edit the files by hand if you want. Files storing virtual users have one line per user. These lines have the following syntax: <account>:<password>:<uid>:<gid>:<gecos>:<home directory>:<uploadbandwidth>:<download bandwidth>:<upload ratio>:<download ratio>:<max number of connections>:<files quota>:<size quota>:<authorized local IPs>:<refused local IPs>:<authorized client IPs>:<refused client IPs>:<time restrictions>
Fields can be left empty (exceptions: account, password, uid, gid, home directory) . --------------------------------------------------------- Alternatively, you may be able to do something like: echo "password\npassword" | pure-pw useradd ...but I don't run or have the pure ftp stuff installed, so I can't promise that that will work. Depends on how the command reads input from stdin.
Hope that helps Cheers Adam
Attachment:
signature.asc
Description: OpenPGP digital signature