Solidt.eu
  • Home
  • Code snippets
  • News

SSH Run remote commands

Date: 2024-03-04
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
Loading