コード例 #1
0
    def authenticator(self) -> auth.Authenticator:
        """
        Return an :class:`~tbot.machine.linux.auth.Authenticator` that allows logging in on this LabHost.

        Defaults to a private key authenticator using ``~/.ssh/id_rsa`` or the first key
        specified in ``~/.ssh/config``.
        """
        if "identityfile" in self._c:
            assert isinstance(self._c["identityfile"], list)
            return auth.PrivateKeyAuthenticator(
                pathlib.Path(self._c["identityfile"][0]))

        return auth.PrivateKeyAuthenticator(pathlib.Path.home() / ".ssh" /
                                            "id_rsa")
コード例 #2
0
ファイル: machine.py プロジェクト: cmhe/tbot
    def authenticator(self) -> auth.Authenticator:
        """
        Return an authenticator that allows logging in on this machine.

        .. danger::
            It is strongly advised to use key authentication.  If you use password
            auth, **THE PASSWORD WILL BE LEAKED** and **MIGHT EASILY BE STOLEN**
            by other users on your labhost.  It will also be visible in the log file.

            If you decide to use this, you're doing this on your own risk.

            The only case where I support using passwords is when connecting to
            a test board with a default password.

        :rtype: tbot.machine.linux.auth.Authenticator
        """
        return auth.PrivateKeyAuthenticator(pathlib.Path.home() / ".ssh" /
                                            "id_rsa")