tree: 8b681d7c7aaa9018219439f14f7a8682eef358b4 [path history] [tgz]
  1. corp-ssh-helper-helper-client.py
  2. corp-ssh-helper-helper-server.py
  3. README.md
contrib/corp-ssh-helper-helper/README.md

corp-ssh-helper-helper

corp-ssh-helper-helper is a helper tool to interact with DUTs (DUT stands for Device under test) from inside the ChromiumOS SDK chroot where corp-ssh-helper is not available.

Prerequisites

If you have installed a similar tool (e.g. go/old-corp-ssh-helper-helper), please remember to uninstall it before using this.

Namely, there should be nothing existing at /usr/bin/corp-ssh-helper in your ChromiumOS SDK chroot. Also src/scripts/.local_mounts shouldn't contain /usr/bin/corp-ssh-helper.

(inside the chroot) $ ls /usr/bin/corp-ssh-helper  # This should fail
(inside the chroot) $ grep /usr/bin/corp-ssh-helper ~/chromiumos/src/scripts/.local_mounts # This shouldn't match with any line

Install

To install corp-ssh-helper-helper, create a symbolic link to corp-ssh-helper-helper-client.py at /usr/bin/corp-ssh-helper inside the ChromiumOS SDK chroot.

To do this, run the following command inside the chroot.

(inside the chroot) $ sudo ln -s ~/chromiumos/src/platform/dev/contrib/corp-ssh-helper-helper/corp-ssh-helper-helper-client.py /usr/bin/corp-ssh-helper

Set up ~/.ssh/config inside the chroot

If you are lucky, you don't have to do anything, as cros_sdk copies ~/.ssh/config outside the chroot when entering the chroot, and your config file may contain the required ProxyCommand setup. Otherwise, you need to create ~/.ssh/config inside the chroot, and the following is to use the helper for $DUT (replace $DUT with an IP address or a host name).

Host $DUT
  ProxyCommand corp-ssh-helper %h %p

See http://go/arc-corp-ssh-helper-notes and http://go/chromeos-lab-duts-ssh to learn more.

How to use

Run the server outside the chroot

To use corp-ssh-helper-helper, you need to start the server outside the chroot.

(outside the chroot) ~/chromiumos % src/platform/dev/contrib/corp-ssh-helper-helper/corp-ssh-helper-helper-server.py

Use SSH

After starting the server, you can use SSH in the same way as you do outside the chroot. The client script will automatically forward the connection request to the server running outside the chroot.

(inside the chroot) $ ssh $DUT

The same goes for tools like tast run and cros deploy.

Uninstall

You can uninstall this tool by deleting /usr/bin/corp-ssh-helper and ~/chromiumos/corp-ssh-helper-helper.sock inside the chroot.

Warning: Do not run the below command outside the chroot as it'll delete the real corp-ssh-helper.
(inside the chroot) $ sudo rm /usr/bin/corp-ssh-helper ~/chromiumos/.corp-ssh-helper-helper.sock