# Timeout: timed out trying connect to multiple SSH

**URL:** <https://forum.robotframework.org/t/timeout-timed-out-trying-connect-to-multiple-ssh/7203>\
**Category:** SSHLibrary\
**Created:** [23 April 2024 21:45 UTC](https://forum.robotframework.org/t/timeout-timed-out-trying-connect-to-multiple-ssh/7203 "2024-04-23T21:45:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rockberto18](https://avatars.discourse-cdn.com/v4/letter/r/a4c791/32.png) [@Rockberto18](https://forum.robotframework.org/u/Rockberto18)\
**Post date:** [23 April 2024 21:45 UTC](https://forum.robotframework.org/t/timeout-timed-out-trying-connect-to-multiple-ssh/7203/1 "2024-04-23T21:45:45Z")

</div>

Hi all,

Im new into robot and Im trying to connect into a multiples devices and once I run I got a time out error, i tried to add a read until get a message from the connection but same error, find below the bloc of code

```
${ips}= OperatingSystem.Get File ${CURDIR}${/}..${/}Output_files${/}ips.txt
    @{ip_list}= Split String ${ips} \n
    FOR ${ip} IN @{ip_list}
        Open Connection ${ip} alias=${ip}_${ip_list}
        Log To Console Loggin in ${ip}
        Login ${user_networkcard} ${user_networkcard_password} 
        SSHLibrary.Read Until Logging into
        Write ip a show dev eth0
        ${ip_eth0_avahi}= Read Until scope link eth0:avahi
        Log To Console ${ip_eth0_avahi}
        Close Connection
    END

```

---

<div class="post-metadata">

**Author:** ![damies13](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/damies13/32/623_2.png) [@damies13](https://forum.robotframework.org/u/damies13)\
**Post date:** [23 April 2024 23:14 UTC](https://forum.robotframework.org/t/timeout-timed-out-trying-connect-to-multiple-ssh/7203/2 "2024-04-23T23:14:31Z")

</div>

Hi Roberto,

You didn’t say which line gave you the error or what the error was, so the best we can do is guess.

- my first guess would be the `alias=${ip}_${ip_list}` might be causing you issues?
  - are you sure you want the ful list of IP’s in your alias name?
  - usually alias’s are short otherwise what’s the point of them?
  - i suggest you try changing the alias to just `alias=${ip}`for now and see if that works

Also have you considered a test template ([DataDriven Tests](https://docs.robotframework.org/docs/testcase_styles/datadriven))?

- put the part in the for in a keyword, this keyword becomes your test template
- use datadriver to read `${CURDIR}${/}..${/}Output_files${/}ips.txt` and create a new test for each IP
- this way when one of the hosts fails only that test fails rather than the single test you have now failing and you have to drill down into the loop to figure out which host failed
- also with test template all hosts will get tested and you’ll know if several hosts fail, where with your current test if the first host fails you won’t know if any of the others pass?

Hope that helps,

Dave.
