Merge pull request #183 from lucasdellasantina/SimplifyingFingerprintInScript

Simplifying fingerprint in the script with (-o StrictHostKeyChecking=no)
pull/184/head
Paul Philippov 2023-10-11 08:30:40 -04:00 committed by GitHub
commit b384a3a2cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 6 deletions

View File

@ -37,11 +37,13 @@ install sshpass
``` ```
apk add sshpass apk add sshpass
``` ```
**Note:** You can test sshpass with
``` ```
sshpass -p '123456' ssh root@192.168.1.29 sshpass -p '123456' ssh root@192.168.1.29
``` ```
**Note:** run to add the fingerprints, otherwise the script will not work
Add those lines to configuration.yaml Add those lines to configuration.yaml
``` ```
@ -110,35 +112,35 @@ read name
echo "#!/bin/bash echo "#!/bin/bash
# Conctate al servidor remoto utilizando sshpass y la contraseña # Conctate al servidor remoto utilizando sshpass y la contraseña
sshpass -p '"$password"' ssh "$user"@"$ip" <<EOF sshpass -p '"$password"' ssh -o StrictHostKeyChecking=accept-new "$user"@"$ip" <<EOF
# Dentro del servidor remoto, ejecuta el comando t31-kmotor con los argumentos # Dentro del servidor remoto, ejecuta el comando t31-kmotor con los argumentos
t31-kmotor -d h -r t31-kmotor -d h -r
EOF EOF
"> "$name"_r.sh "> "$name"_r.sh
echo "#!/bin/bash echo "#!/bin/bash
# Conctate al servidor # Conctate al servidor
sshpass -p '"$password"' ssh "$user"@"$ip" <<EOF sshpass -p '"$password"' ssh -o StrictHostKeyChecking=accept-new "$user"@"$ip" <<EOF
# Dentro del servidor remoto, ejecuta el comando t31-kmotor # Dentro del servidor remoto, ejecuta el comando t31-kmotor
t31-kmotor -d g -x -300 -y 0 t31-kmotor -d g -x -300 -y 0
EOF EOF
"> "$name"_x_down.sh "> "$name"_x_down.sh
echo "#!/bin/bash echo "#!/bin/bash
# Conctate al servidor # Conctate al servidor
sshpass -p '"$password"' ssh "$user"@"$ip" <<EOF sshpass -p '"$password"' ssh -o StrictHostKeyChecking=accept-new "$user"@"$ip" <<EOF
# Dentro del servidor remoto, ejecuta el comando t31-kmotor # Dentro del servidor remoto, ejecuta el comando t31-kmotor
t31-kmotor -d g -x 300 -y 0 t31-kmotor -d g -x 300 -y 0
EOF EOF
"> "$name"_x_up.sh "> "$name"_x_up.sh
echo "#!/bin/bash echo "#!/bin/bash
# Conctate al servidor # Conctate al servidor
sshpass -p '"$password"' ssh "$user"@"$ip" <<EOF sshpass -p '"$password"' ssh -o StrictHostKeyChecking=accept-new "$user"@"$ip" <<EOF
# Dentro del servidor remoto, ejecuta el comando t31-kmotor # Dentro del servidor remoto, ejecuta el comando t31-kmotor
t31-kmotor -d g -x 0 -y -300 t31-kmotor -d g -x 0 -y -300
EOF EOF
"> "$name"_y_down.sh "> "$name"_y_down.sh
echo "#!/bin/bash echo "#!/bin/bash
# Conctate al servidor # Conctate al servidor
sshpass -p '"$password"' ssh "$user"@"$ip" <<EOF sshpass -p '"$password"' ssh -o StrictHostKeyChecking=accept-new "$user"@"$ip" <<EOF
# Dentro del servidor remoto, ejecuta el comando t31-kmotor # Dentro del servidor remoto, ejecuta el comando t31-kmotor
t31-kmotor -d g -x 0 -y 300 t31-kmotor -d g -x 0 -y 300
EOF EOF