How do you create a FTP user from a PHP script?

5 replies
Does anyone know how to create an FTP user from a PHP script. I have a way but its kinda... rigged up funny. If anyone has an efficient way let me know.
#create #ftp #php #script #user
  • Profile picture of the author LazzyHoney
    Banned
    [DELETED]
    {{ DiscussionBoard.errors[3994968].message }}
    • Profile picture of the author mattleaconsulting
      Interesting, is there any issue with that not running as root, because its forcing me to be root to add users.

      Either way Thanks!
      {{ DiscussionBoard.errors[3997597].message }}
  • Profile picture of the author imarketstuff
    one way to accomplish it, if your domain is using cpanel:

    - review what script is being used by cpanel to create the account.
    - take note of everything that is needed (cpanel user,cpanel pass, port,script name,parameters)
    - create a php script that passes the correct auth info, new account info

    i do something similar already, and here is the snippet of code that does the call to the cpanel script..

    note, my variable names keep getting stripped out in the forum post so i'm just putting placeholders for you to see:

    PHP Code:
    // CODE TO POST CREATION REQUEST
    script_url_variable "http://:@:2082/frontend/x2/mail/doaddfwd.html?email=&domain=&forward=";
    result_variable file_get_contents(script_url_variable); 
    peace
    Signature
    I MARKET STUFF

    {{ DiscussionBoard.errors[3999893].message }}
  • Profile picture of the author ionisis
    Your vsftpd.conf can make use of a generic GROUP/User which all users will be issued. That eliminates the need to add group/user accounts.
    {{ DiscussionBoard.errors[4057905].message }}
  • Profile picture of the author victorjames
    you can get help about php from w3schools.com...you will some nice tutorials there.
    {{ DiscussionBoard.errors[4059506].message }}
    • Profile picture of the author ionisis
      Originally Posted by victorjames View Post

      you can get help about php from w3schools.com...you will some nice tutorials there.
      Why would you send them there? w3schools COPIES content from php.net, so you should ONLY give credit to the original source: php.net.

      I hate when people do that. It's like when facebook uses wikipedia content to generate content to get more traffic: it's pathetic, and it takes away from wikipedia, and all those kind people who took the time to develop the articles on wikipedia, which we should all be GRATEFUL for. Same for php.net.

      Wikipedia and php.net spend millions of dollars in infrastructure, and thousands of hours in free man-power, to bring open knowledge to the world; and facebook, and w3schools, and users like YOU, spit in the face of wikipedia and php.net by clicking on links to facebook or w3schools, or referring other people there.

      Stop giving credit to other sources. That's not cool. It gives the original authors NO reason to continue trying to provide the world with open knowledge. That is the VERY REASON why some companies will not go open source: they will never get full appreciation of what they're offering, because others will STEAL their thunder.

      Give credit where credit is DUE: PHP: Hypertext Preprocessor and Wikipedia
      {{ DiscussionBoard.errors[4060984].message }}

Trending Topics