Skip to content

Instantly share code, notes, and snippets.

@muhamad-ridwant-tech
Created July 15, 2025 03:51
Show Gist options
  • Save muhamad-ridwant-tech/96dff0219dae405184ff3ce48832ad84 to your computer and use it in GitHub Desktop.
Save muhamad-ridwant-tech/96dff0219dae405184ff3ce48832ad84 to your computer and use it in GitHub Desktop.
Write EoF with SSH Loop
[ridwan@WarMachine]$
for i in {01,02,03}; do ssh root@MicroCloud-${i} "hostname && lsb_release -d && \
cat <<'EOF' | tee /etc/hosts
# Server MicroCloud
127.0.0.1 localhost
192.168.100.101 MicroCloud-01
192.168.100.102 MicroCloud-02
192.168.100.103 MicroCloud-03
EOF";done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment