
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Execute commands on multiple remote SSH sessions
SSHSession
from ssh_session_manager.Command import Command
from ssh_session_manager.SSHSession import SSHSession
ls_command = Command("ls -la")
ps_command = Command("ps -ax")
commands = [
ls_command,
ps_command
]
with SSHSession("Silver Server", "10.0.0.57", "user", "password") as ssh_session:
for command in commands:
ssh_session.run_command_in_ssh_session(command)
command_output_dictionary = ssh_session.get_command_output_dictionary(ps_command)
standard_output_lines = command_output_dictionary["standard_output_lines"]
standard_error_lines = command_output_dictionary["standard_error_lines"]
exit_status = command_output_dictionary["exit_status"]
SSHSessionManager
from ssh_session_manager.Command import Command
from ssh_session_manager.SSHSession import SSHSession
from ssh_session_manager.SSHSessionManager import SSHSessionManager
ssh_session_1 = SSHSession("Silver Server", "10.0.0.57", "user", "password")
ssh_session_2 = SSHSession("Black Server", "10.0.0.58", "user", "password")
ssh_sessions = [
ssh_session_1,
ssh_session_2
]
ls_command = Command("ls -la")
ps_command = Command("ps -ax")
commands = [
ls_command,
ps_command
]
with SSHSessionManager(ssh_sessions) as ssh_session_manager
ssh_session_manager.run_commands_in_ssh_sessions(commands)
command_output_dictionary = ssh_session_manager.get_command_output_dictionary(ssh_session_1, ls_command)
standard_output_lines = command_output_dictionary["standard_output_lines"]
standard_error_lines = command_output_dictionary["standard_error_lines"]
exit_status = command_output_dictionary["exit_status"]
FAQs
Execute commands on multiple remote SSH sessions
We found that ssh-session-manager demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.