Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Manage features API questions

Discussion in 'Security' started by Dev@SH, Jun 27, 2018.

Tags:
  1. Dev@SH

    Dev@SH Member

    Joined:
    Mar 11, 2014
    Messages:
    17
    Likes Received:
    1
    Trophy Points:
    3
    cPanel Access Level:
    DataCenter Provider
    Hello,

    cPanel 72.0 (build 5)

    Ok, help me understand this:

    - is the "SSH Access & Terminal" feature called "ssh" or "terminal"?
    - Is this feature enabled by default in 72? If so, why?
    - I see that there is a /var/cpanel/disable_whm_terminal_ui file that can be created, is there a cpanel side equivalent?
    - what is the correct syntax for this command?
    Code:
    whmapi1 manage_features action=disable features=terminal
    Error below
    Code:
     
    [root@server ~]# whmapi1 manage_features action=disable features=terminal
    die [xml-api] 'enable' must be implemented by subclasses of 'Cpanel::Config::ConfigObj::Interface::Config::v1'
    ---
    metadata:
      command: manage_features
      reason: "API failure: exit level [die] [pid=28981] ('enable' must be implemented by subclasses of 'Cpanel::Config::ConfigObj::Interface::Config::v1')\n"
      result: 0
      version: 1
    
    Called 'terminal' here
    Code:
    [root@server ~]# whmapi1 manage_features action=list
    ---
    data:
      feature:
        ...SNIP...
        -
          enabled: 0
          feature_key: terminal
    


    Called 'ssh' here
    Code:
    [root@server ~]# whmapi1 get_feature_names
    ---
    data:
      feature:
    ...SNIP...
        -
          id: ssh
          name: SSH Access & Terminal
    ...SNIP...
    metadata:
      command: get_feature_names
      reason: OK
      result: 1
      version: 1
    
    I can turn it off this way but does that turn off just the terminal or also ssh access via a non-webshell?
    Code:
    [root@server ~]# whmapi1 update_featurelist featurelist=default ssh=0
    ---
    data:
      featurelist: default
      invalid_features: []
    
      updated_features:
        ssh: 0
    metadata:
      command: update_featurelist
      reason: OK
      result: 1
      version: 1
    
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,749
    Likes Received:
    1,885
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello @Dev@SH,

    Here's the relevant section from the cPanel & WHM Version 72 Release Notes:

    The feature name to look for is SSH Access & Terminal if you are modifying the feature list through Web Host Manager. If you're using one of the WHM API 1 feature list functions, then the feature name is ssh (it appears as ssh in the feature list files within the /var/cpanel/features/ directory).

    Both WHM's Terminal interface and cPanel's Terminal interface are enabled by default. Keep in mind it's not granting SSH access to an account (e.g. root) that doesn't already have the ability to grant SSH access to itself, and it's not enabling SSH access for cPanel users (that's still controlled through WHM >> Manage Shell Access).

    There's no touch file for the corresponding cPanel feature, but you can disable the feature for cPanel users by adding it to the disabled feature list in WHM >> Feature Manager or by using the following WHM API 1 function via the command line:

    WHM API 1 Functions - update_featurelist - Developer Documentation - cPanel Documentation

    EX:

    Code:
    whmapi1 update_featurelist featurelist=disabled ssh=0
    The correct command to use is noted in the answer above. Enabling or disabling this feature does not affect whether an account is granted SSH access. It only determines if cPanel users can access the SSH Access & Terminal option.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice