Create new FTP User
-
- Posts: 1
- Joined: Tue Feb 10, 2015 12:46 pm
Create new FTP User
Hi. I'm from Poland and have problem. I have this code and doesn't perform on my command.
Just don't execute commands and doesn't add ftp account.
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>
Re: Create new FTP User
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?
not "sudo v-add-web-domain-ftp" ?
May be script don't have enough permission?
Re: Create new FTP User
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
http://vestacp.com/docs/API.pdf
CLI commands list and descriptions:
http://vestacp.com/docs/CLI.txt
-> viewtopic.php?f=18&t=12610