Skip to content
Solidt.eu
  • Home
  • Code snippets
  • News

SSH Run remote commands

March 4, 2024
ssh user@host 'bash -s' < my_script.sh


(cat <<END
df -h
date
uptime
uname -a
apt update && apt upgrade -y && apt autoremove -y
END
) | ssh user@host 'bash -s'

See also:

How to create a LXD Container with your ssh key in it (and with ssh server in the container)
834200cookie-checkSSH Run remote commandsno

Solidt.eu