1. 23
  1.  

  2. 3

    We’ve used expect for automatically testing a router CLI over telnet back in the days. I remember that experience as outright painful. So many, ahem, unexpected things can break the process.

    It may be somewhat better for purely local applications of course.

    1. 1

      A great use I found for this is a script that lets me scp files to an embedded machine without typing the password each time.

      1. 6

        I’m glad that your workflow works for you, and I know there may be constraints that I’m not aware of, but I feel like I should mention ssh-agent as another way to solve this problem, just in case.

        1. 6

          The ssh fingerprint changes with every boot on the device, as we don’t persist much right now. It’s on the list of things to fix one day. :)

          1. 1

            Without wanting to invalidate your use case: This sounds like the machine is in development. Wouldn’t it be possible to have an authorized key baked into the filesystem from which it boots (which the build system only does on development/testing builds of the image)?

            1. 1

              It is! It is a bit of a process and I don’t work directly with the hardware side of things, so the expect script is a hack. :)

        2. 1

          You can’t use public key authentication?