# Run Linux commands with SSH

Run Linux commands with SSH on Evotec with practical examples, usage guidance, and reusable project workflows.

Project

Transferetto

Small PowerShell module with FTPS/SFTP functionality

[View on GitHub](https://github.com/EvotecIT/Transferetto) [Visit Website](#) [Releases](https://github.com/EvotecIT/Transferetto/releases/tag/Transferetto-v2.0.0) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/Transferetto)

Stars**93**

Forks**18**

Open issues**0**

PowerShell Gallery downloads**14067470**

Release**v2.0.4**

Language: C# Updated: 2026-11-17

Curated Examples

Use Transferetto to send one-shot Linux commands over SSH from PowerShell.

This pattern is useful when PowerShell should ask a Linux host for status or run a short sequence of commands without opening a longer interactive session.

It is adapted from the source example at `Examples/Example08-ConnectSSH.ps1`.

## When to use this pattern

- A few commands should run in order over SSH.
- You do not need prompt-aware shell automation yet.
- The result can be returned as command output directly.

## Example

```powershell
Import-Module Transferetto

$sshClient = Connect-SSH -Server 'server.example.com' -Credential (Get-Credential)

$command = {
    'cd /var/www/html'
    'ls -la'
    'cat /etc/os-release'
}

Send-SSHCommand -SshClient $sshClient -Command $command
Disconnect-SSH -SshClient $sshClient
```

## What this demonstrates

- opening an SSH session from PowerShell
- sending multiple Linux commands as one scripted block
- returning command output without managing an interactive shell

## Source

- [Example08-ConnectSSH.ps1](https://github.com/EvotecIT/Transferetto/blob/master/Examples/Example08-ConnectSSH.ps1)

<!-- PowerForge markdown artifact sha256:5697A961E7CCBCD430132297900720F495F6FB3DA2EBAD0320C59BF41B9DB18C -->
