The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WHM add user to /etc/ftpusers on account creation

Discussion in 'General Discussion' started by Bradl3y, Jul 20, 2007.

  1. Bradl3y

    Bradl3y Member

    Joined:
    Nov 14, 2005
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    By default, I do not want any account created in WHM to have FTP access. I want to be able to grant specific accounts FTP access if i wish. I use Pure-FTPD.

    Pure-FTPD supports the /etc/ftpusers file. Adding a line with the username will prevent that user from connecting via ftp. Is there a way to have WHM automatically add the username to the ftpusers list when the account is created?

    The other possible solutions i see for my problem would be using the minUID setting to restrict users, or disabling unix authentication for Pure-FTPD all together, and set up virtual accounts PureDB. It seems adding them to the ftpusers list would make the most sense.
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    You could always use the /scripts/postwwwacct hook to execute a script every time an account is created. Here's a link to documentation on how to use that script:

    http://www.cpanel.net/support/docs/hooks.htm#postwww
     
  3. Bradl3y

    Bradl3y Member

    Joined:
    Nov 14, 2005
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    Thanks, I researched that a bit and used postwwwacctuser instead. I created the file /etc/postwwwacctuser with permissions 700 and 1 line of text:

    Code:
    echo $1 >> /etc/ftpusers
    Seems to do the trick. Anyone that sees any problems with this please let me know.
     
    #3 Bradl3y, Jul 20, 2007
    Last edited: Jul 20, 2007
Loading...

Share This Page