Score:1

ssh to remote host from a list of hosts from a file

jo flag

What to use for loop to log into websevers using this command?

for host in $(cat remhost); do
   ssh devops@$host uptime;
done

keep getting:

ssh: Could not resolve hostname host: Name or service not known

what do I need to correct?

kanehekili avatar
zw flag
Nice that you've dropped by, but this forum is for ubuntu specific questions. Yours is a general linux question (since you didn't even wrote which Ubuntu version you are using). [This site](https://unix.stackexchange.com/) will gladly answer your questions without asking which distro and version you are using ;-)
hr flag
@kanehekili [Are bash/shell scripting questions on topic?](https://meta.askubuntu.com/questions/13807/are-bash-shell-scripting-questions-on-topic)
kanehekili avatar
zw flag
@steeldriver Yes, if we roam in the Ubuntu universe:`Shell scripting is an integral part of managing a Linux system`
Terrance avatar
id flag
It is hard to say why it is showing `host` since we don't know what the format of your `remhost` file is.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.