GithubHelp home page GithubHelp logo

liwyd / pyssh Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 8 KB

An application to modify ssh-Xpanle - python - ssh Tunnel - ssh panel - vpn - vpn manager

Home Page: https://github.com/xpanel-cp/XPanel-SSH-User-Management

License: MIT License

Python 100.00%
api python ssh ssh-tunnel telegram-bot-api vpn vpn-server xpanel xpanelssh pyhton-ssh

pyssh's Introduction

PySSH

An application coded with python that allows you to modify your Xpanel (Xpanel)

How To Use

  • clone the repository
git clone https://github.com/Liwyd/pyssh.git
  • Import pyssh in your .py file
from pyssh import pyssh

# Setup a login
panel = ssh(
    domain="liwyd.com",
    token="ThisIsATokenForTest",
    port=80
    verified=False # Remember the ' verified ' option is not compulsory !
)
  • Get clients list
GetList = panel.GetList()

# Result

[
    {
        "id":3,
        "username":"liwyd",
        "password":"liwydpasswd",
        "email":null,
        "mobile":null,
        "multiuser":"5",
        "start_date":"2023-10-05",
        "end_date":"2067-07-05",
        "date_one_connect":"0",
        "customer_user":"Ali",
        "status":"active",
        "traffic":"102400",
        "referral":"",
        "desc":null,
        "created_at":"2023-10-05T11:34:53.000000Z",
        "updated_at":"2023-10-05T21:02:03.000000Z",
        "traffics":[{"id":3,
        "username":"liwyd",
        "download":"3559",
        "upload":"7127",
        "total":"10686",
        "created_at":"2023-10-05T11:34:53.000000Z",
        "updated_at":"2023-10-10T19:23:34.000000Z"}]
    }
]
  • Add client
get = panel.AddClient(
    username='test',
    password="test123",
    Traffic = "5000",# in megabytes
    IpLimit = "1",
    expdate = "2023-07-04",
    Email="[email protected]",
    PhoneNumber = "095368709120",
    connection_start = "30", # If you want to set the expdate on the first connection, enter the number of validity days
)
  • Edit the existing client
get = panel.AddClient(
    username='test',
    password="test123",
    Traffic = "5000",# in megabytes
    IpLimit = "1",
    expdate = "2023-07-04",
    Email="[email protected]",
    PhoneNumber = "095368709120"
)
  • Get client's information:
GetClient = panel.GetClient(
    username="liwyd",
)

# Result
[
    {
        "id":3,
        "username":"liwyd",
        "password":"liwydpasswd",
        "email":null,
        "mobile":null,
        "multiuser":"5",
        "start_date":"2023-10-05",
        "end_date":"2067-07-05",
        "date_one_connect":"0",
        "customer_user":"Ali",
        "status":"active",
        "traffic":"102400",
        "referral":"",
        "desc":null,
        "created_at":"2023-10-05T11:34:53.000000Z",
        "updated_at":"2023-10-05T21:02:03.000000Z",
        "traffics":[{"id":3,"username":"liwyd",
        "download":"3562","upload":"7137",
        "total":"10699",
        "created_at":"2023-10-05T11:34:53.000000Z",
        "updated_at":"2023-10-10T19:36:50.000000Z"}]},
        {"port_direct":"2794",
        "port_tls":"444",
        "port_dropbear":"2792",
        "message":"success"
    }
]
  • Active/Dective client:
active = panel.ActiveClient(
    username="liwyd",
)

dective = panel.DectiveClient(
    username="liwyd",
)
  • Delete existing client:
get = panel.RemoveClient(
    username="liwyd",
)
  • Reset existing client's Traffic:
get = panel.ResetTraffic(
    username="liwyd",
)
  • Add Traffic to existing client:
get = panel.AddTraffic(
    username="liwyd",
    traffic="5000",# in megabytes
)
  • Renewal the existing client:
get = panel.Renewal(
    username="liwyd",
    day_date="5", #Credit in the form of days.
    re_date=False,
    re_traffic=False,
)
  • KillUser:
get = panel.KillUser(
    username="liwyd",
)
  • KillPID:
get = panel.KillPid(
    PID="liwyd",
)

Get the Online users

users = panel.OnlineUsers()

Check the filtering status

get = panel.Filtering()

# Result:
"[STATUS]: everything is ok!"

Download DataBase

get = panel.DownloadDataBase()

# Result:
"file [XPanel-2023-10-10---06-22-14.sql] saved!"

pyssh's People

Contributors

liwyd avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.