Skip to content

Latest commit

 

History

History
executable file
·
58 lines (48 loc) · 1.3 KB

README.md

File metadata and controls

executable file
·
58 lines (48 loc) · 1.3 KB

SSH Services 1.1

Install and Import the module :

Installing the module :

~ git clone https://github.com/gabriel-dahan/ssh-services/
~ cd sshservices/

# Linux / MacOS
~ python3 -m pip install -U .

# Windows 
~ py -3 -m pip install -U .

Consider using the --user parameter if you're not a root/admin user.

Importing the module :

import sshservices

Create an SSH connection.

from sshservices import SSHConnection

ssh_conn = SSHConnection(
    '0.0.0.0', # IPv4
    'testuser', # Username
    'Testing1234', # Password
    22 # Port (default: 22)
)

ssh_conn.connect() # Launches a connection to the specified server.

Save and Delete an SSH connection.

Save

from sshservices import SSHConnection, SSHManager

ssh_conn = SSHConnection(...)
ssh_conn.save('MySSHConnection') # Save the profile with a name (don't reuse the same name as others profiles, it'll override them).

# Later
sshm = SSHManager()

sshm.get('MySSHConnection').connect() # Connect to a specific profile.
sshm.interactive_conn() # Prompt a list of the profiles and let the user choose one.

Delete

sshm = SSHManager()
sshm.delete('MySSHConnection')

Get all profiles.

sshm = SSHManager()
sshm.profiles() # --> Returns a list of all the profiles.