Unable to add shell users using sites_shell_user_add

Discussion in 'Developers' Forum' started by Thrash Cardiom, Mar 12, 2019.

  1. Thrash Cardiom

    Thrash Cardiom New Member

    I'm getting this error,directory_error_notinweb, when trying to add a shell user

    I'm using ispconfig 3.1.13. I have a script which runs through and creates the Client, Domain, Database user, and Database. It fails when trying to create the shell user:

    The variables $domain_id, $shell_username, $shell_password, $client_id are all set correctly
    Code:
    $shellParams = array(
       'server_id' => 1,
       'parent_domain_id' => $domain_id,
       'username' => $shell_username,
       'password' => $shell_password,
       'quota_size' => -1,
       'active' => 'y',
       'puser' => 'web' . $domain_id,
       'pgroup' => 'client' . $client_id,
       'shell' => '/bin/bash',
       'dir' => '/var/www/clients/client' . $client_id . '/web' . $domain_id;
       'chroot' => 'jailkit'
    );
    
    // Shell user
     $shell_user_id = $client->sites_shell_user_add( $session_id, $client_id, $shellParams );
    Any ideas on this would be welcome.
     
  2. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    Did you create a web site first?
     
  3. Thrash Cardiom

    Thrash Cardiom New Member

    Yes, I did. All directories etc. are created earlier in the script.
     
  4. Thrash Cardiom

    Thrash Cardiom New Member

    Annoyingly I can create the client, site, database etc. using the script and can then add the jailkit user using the ispconfig web interface.
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    Compare the shell user in the database that you created from within ispconfig with the one you created with the api and adjust the api params of the function call you use to match the ones of the working user.
     
  6. Thrash Cardiom

    Thrash Cardiom New Member

    Thanks for the tip. I'll try later today
     
  7. Thrash Cardiom

    Thrash Cardiom New Member

    All good, thank you. Sometimes we are blind to our own stupidity.
     

Share This Page