Page 1 of 1

Create new FTP User

Posted: Tue Feb 10, 2015 12:50 pm
by Kawamintai
Hi. I'm from Poland and have problem. I have this code and doesn't perform on my command.

Code: Select all

<?php
if(isset($_POST['send_ftp'])) {
$domain = addslashes($_POST['domain']);
$ftpuser = addslashes($_POST['ftpuser']);
$ftppass = addslashes($_POST['ftppass']);
$connection = ssh2_connect('188.68.238.3', 22);
ssh2_auth_password($connection, 'root', 'sshpassword');
ssh2_exec($connection, 'v-add-web-domain-ftp admin $domain $ftpuser $ftppass public_html');
}
?>
 <form action="test.php" method="post">
    <input type="text" name="domain" value="domain">
        <input type="text" name="ftpuser" value="ftpuser">
        <input type="password" name="ftppass" value="ftppass">
        <input name="send_ftp" type="submit" class="btn btn-primary" value="Add">
 </form>
Just don't execute commands and doesn't add ftp account.

Re: Create new FTP User

Posted: Sun Mar 15, 2015 10:32 pm
by skurudo
ssh2_exec($connection, 'v-add-web-domain-ftp admin $domain $ftpuser $ftppass public_html');

not "sudo v-add-web-domain-ftp" ?
May be script don't have enough permission?

Re: Create new FTP User

Posted: Fri Sep 23, 2016 12:32 pm
by skurudo
API documentation and examples:
http://vestacp.com/docs/API.pdf

CLI commands list and descriptions:
http://vestacp.com/docs/CLI.txt

-> viewtopic.php?f=18&t=12610