E
E
Erouech2020-08-19 09:37:35
bash
Erouech, 2020-08-19 09:37:35

How to form a sequence of bash commands in a sh file?

Good morning.
There is a need to send the "ssh-copy-id" command to a number of servers, and enter passwords. But it takes a long time to do it by hand.
I know ip, port, username and password.
How to make everything automatic in sh file?

(Some servers don't need to confirm " Are you sure you want to continue connecting (yes/no)? ", while others do)

# Это не сработало,
ssh-copy-id [email protected];
pass;
...

# И это не сработало
ssh-copy-id [email protected] && pass;
ssh-copy-id [email protected] && pass;

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Barbolin, 2020-08-19
@erouech

https://srvfail.com/how-to-provide-ssh-password-in...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question