Skip to main content

snippets_py

Integration

New integration from credential
ssh_connection = yepcode.integration.ssh2("credential-slug")
New integration from plain authentication data (username and password)
from paramiko.client import SSHClient

ssh_connection = SSHClient()
ssh_connection.connect(
hostname='hostname',
port='portNumber',
username='username',
password='password'
)
New integration from plain authentication data (private key)
from paramiko.client import SSHClient

ssh_connection = SSHClient()
ssh_connection.connect(
hostname='hostname',
port='portNumber',
username='username',
pkey='privateKey'
)

Interactive Shell Session

Shell session
## The command’s input and output streams are returned as Python file-like objects representing stdin, stdout, and stderr.
## Official docs: https://docs.paramiko.org/en/latest/api/client.html
ssh_stdin, ssh_stdout, ssh_stderr = ${1.ssh_connection}.exec_command('your-command-here')