Using ssh2 php command to create user OpenConnect VPN Server with dockers

56 Views Asked by At

I want to create user in ocserv in dockers with ssh2 php command:

$ssh_connection = ssh2_connect($ip, $port); 
if(ssh2_auth_password($ssh_connection, $user, $pass))
{
$stream  = ssh2_exec($ssh_connection, "docker exec --tty ocserv ocpasswd -c /etc/ocserv/ocpasswd testUserAPI;");
}

first line is working, But it require password twice after this command to create user, so how can I do that?

0

There are 0 best solutions below