remote_access: Don't force ssh port to 22 if unspecified

It's possible to specify a default port for a DUT in your .ssh/config
file.  This is super useful if your setup looks like this:

Local DUT ===Ethernet=== Local computer ===SSH=== Remote Build Machine

In the above scenario if your Local DUT had a local IP address of then you could ssh from the local computer to the remote
build machine with:

  ssh -R8022: remote_build_machine

After doing that, you'd define this in your .ssh/config:

  Host my_dut
    Port 8022

...and now you can ssh from your Remote Build Machine do your dut with
just "ssh my_dut".

The problem is: if you try to use update_kernel to update the kernel
of that DUT the port will be overridden back to 22.  :(

Let's fix remote_access to not override the port unless it was


Change-Id: I62d8fd772574d4c6e5fe5ede1a386319438b9b8e
Reviewed-by: Mike Frysinger <>
Reviewed-by: Stephen Boyd <>
Tested-by: Douglas Anderson <>
Commit-Queue: Douglas Anderson <>
1 file changed