Add FTP users with PHP

Discussion in 'PHP' started by webmasterplace, Sep 10, 2009.

  1. #1
    Hi,

    I'd like to know how I can add FTP users to cPanel with PHP.
    I know the function shell_exec() in PHP, but I don't know what Linux command I need to use to create FTP users.

    My home dir is /home/myusername/. Now I'd like that the added FTP user can only access it's own directory.

    For example I create testuser, then testuser must only be able to access /home/myusername/ftpaccounts/testuser/. There should also be an FTP quota for xxx MB.

    Any help appreciated!
    Thanks
     
    webmasterplace, Sep 10, 2009 IP
  2. matthewrobertbell

    matthewrobertbell Peon

    Messages:
    781
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #2
    it's unlikely that your hosting will allow you to directly execute the commands you require. The only alternative I can think of is to write a script that logs into cpanel, mimicing a browser.
     
    matthewrobertbell, Sep 10, 2009 IP
  3. stephan2307

    stephan2307 Well-Known Member

    Messages:
    1,277
    Likes Received:
    33
    Best Answers:
    7
    Trophy Points:
    150
    #3
    stephan2307, Sep 10, 2009 IP
  4. phprightnow

    phprightnow Peon

    Messages:
    296
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #4
    phprightnow, Sep 10, 2009 IP
  5. webmasterplace

    webmasterplace Peon

    Messages:
    802
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I've used something similar to the cPanel API Class.
    Thanks for replying.
     
    webmasterplace, Sep 10, 2009 IP