The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

View suspended accounts via SSH

Discussion in 'General Discussion' started by Rehan_1990, May 25, 2017.

Tags:
  1. Rehan_1990

    Rehan_1990 Member

    Joined:
    Feb 25, 2017
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Pakistan
    cPanel Access Level:
    Root Administrator
    Hi,

    Is there any possibility to see suspended accounts via SSH.

    Thanks.
     
  2. Havri

    Havri Well-Known Member

    Joined:
    Oct 28, 2013
    Messages:
    55
    Likes Received:
    11
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    Hello,

    I think you can check the following folder for each user file:

    ls -al /var/cpanel/suspended/

    The users listed there should coincide with the list in WHM -> List Suspended Accounts.

    Regards.
     
    Rehan_1990 likes this.
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,204
    Likes Received:
    1,297
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
  4. Rehan_1990

    Rehan_1990 Member

    Joined:
    Feb 25, 2017
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Pakistan
    cPanel Access Level:
    Root Administrator
    Thanks for your replay. It was quite helping. My basic concern is to filter the suspended accounts which are moved to other server as we can see this in WHM. Is there any way to filter or see those account which are moved to other server in SSH/command line/Terminal.
     
  5. Havri

    Havri Well-Known Member

    Joined:
    Oct 28, 2013
    Messages:
    55
    Likes Received:
    11
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    Hello,

    Like cPanelMichael said, you can use the API commands from the SSH/Command Line:

    Code:
    whmapi1 listsuspended
    After that, you can parse the output from the API command and look for the "reason:" part.

    Code:
    [root@server1 suspended]# whmapi1 listsuspended
    ---
    data:
      account:
        -
          is_locked: 0
          owner: owner1
          reason: Overdue on Payment
          time: Mon May  8 09:28:31 2017
          unixtime: '1494224911'
          user: suspendeduser1
        -
          is_locked: 0
          owner: owner1
          reason: User transferred to another server.
          time: Wed Feb 15 20:30:00 2017
          unixtime: '1487183400'
          user: suspendeduser2
    metadata:
      command: listsuspended
      reason: OK
      result: 1
      version: 1

    Alternatively, you can use the files in /var/cpanel/suspended/ and look into those files for the reason.

    For example, after a user is transferred to another server using the Transfer Tool, the file from /var/cpanel/suspended/ for that user contains the reason of the suspension:

    Code:
    User transferred to another server.
    Good luck.
     
    cPanelMichael and Rehan_1990 like this.
Loading...

Share This Page