plesk api shell access

2019-09-02 18:44发布

问题:

i try create script to add new domain in plesk whit api, im write this script :

<packet version='1.4.2'> 
<domain>
<add>
   <gen_setup>
      <name>domain.com</name>
      <client_id>1</client_id>
      <ip_address>127.0.0.1</ip_address>
      <status>0</status>
   </gen_setup>
   <hosting>
      <vrt_hst>
          <ftp_login>username</ftp_login>
          <ftp_password>password</ftp_password>
          <php>true</php>
          <ssi>true</ssi>
          <cgi>true</cgi>
          <php_safe_mode>false</php_safe_mode>
          <ip_address>127.0.0.1</ip_address>
      </vrt_hst>
   </hosting>
</add>
</domain>
</packet>

The script add new domain bat not working ssh access, i need add shell access to this script. Thanks all

回答1:

It depends on plesk/protocol version. Try to add <shell>/bin/bash</shell> in <vrt_hst>...</vrt_hst>

Next query works for Plesk 10/11:

<packet version="1.6.3.0">
<webspace>
<add>
   <gen_setup>
      <name>example.com</name>
      <owner-id>1</owner-id>
      <htype>vrt_hst</htype>
      <ip_address>10.0.0.1</ip_address>
      <status>0</status>
   </gen_setup>
   <hosting>
      <vrt_hst>
          <property>
            <name>shell</name>
            <value>/bin/bash</value>
          </property>
          <property>
            <name>ftp_login</name>
            <value>ftp16se4fdf0</value>
          </property>
          <property>
            <name>ftp_password</name>
            <value>qweqwe</value>
          </property>
          <ip_address>10.0.0.1</ip_address>
       </vrt_hst>
    </hosting>
</add>
</webspace>
</packet>


标签: api ssh plesk