Ssh Script

Asked by Matias Bertolotti on 2017-09-11

Hola buenas noches hice este script pero solo me esta funcionando con la primera IP con las otras 2 no se realizan los cambios.
Dejo mi script para que me ayuden. Saludos

#!/bin/bash
HOSTS="192.168.120.237 192.168.120.238 192.168.120.239"
USER=root

# Conectar a cada una de las IP
for host in $HOSTS; do
  ssh "$USER@$HOSTS" 'bash -s arg' < /home/soulfly/Escritorio/neo1isla1.sh
done

Question information

Language:
Spanish Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
2017-09-11
Last reply:
2017-09-12
Manfred Hampl (m-hampl) said : #1

Try

 ssh "$USER@$host" ...

instead of

 ssh "$USER@$HOSTS" ...

Can you help with this problem?

Provide an answer of your own, or ask Matias Bertolotti for more information if necessary.

To post a message you must log in.