Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion atest/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ Additional OpenSSH configuration
Testing pre-login banner


- Add test_hostname, testkey_hostname and test_proxy_hostname in ``~/.ssh/config``
- Add test_hostname, testkey_hostname, test_proxy_hostname and test_user_hostname in ``~/.ssh/config``

::

Expand All @@ -154,6 +154,10 @@ Additional OpenSSH configuration

echo $'Host test_proxy_hostname\n Hostname localhost\n User test\n Port 22\n ProxyCommand ssh -W %h:%p testkey_hostname\n' >> ~/.ssh/config

::

echo $'Host test_user_hostname\n Hostname localhost\n User nonexisting\n Port 22\n' >> ~/.ssh/config


Setup for Docker
================
Expand Down
4 changes: 4 additions & 0 deletions atest/login.robot
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ Login With Public Key Using Config File
[Setup] Open Connection ${TESTKEY_HOSTNAME} prompt=${PROMPT}
Login With Public Key read_config=True

Login With Specified User Differing From Config File
[Setup] Open Connection ${TEST_USER_HOSTNAME} prompt=${PROMPT}
Login ${USERNAME} ${PASSWORD} read_config=True
Comment on lines +73 to +75

Login With No Password
[Setup] Open Connection ${HOST} prompt=${PROMPT}
Login ${USERNAME_NOPASSWD}
Expand Down
1 change: 1 addition & 0 deletions atest/resources/common.robot
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ ${KEY} ${KEY DIR}${/}id_rsa
${TEST_HOSTNAME} test_hostname
${TESTKEY_HOSTNAME} testkey_hostname
${TEST_PROXY_HOSTNAME} test_proxy_hostname
${TEST_USER_HOSTNAME} test_user_hostname
${EMPTY_STRING} \


Expand Down
4 changes: 3 additions & 1 deletion src/SSHLibrary/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -884,8 +884,10 @@ def _login(self, username, password, allow_agent=False, look_for_keys=False, pro
read_config=False, jumphost_connection=None, keep_alive_interval=None, disabled_algorithms=None):
if read_config:
hostname = self.config.host
self.config.host, username, self.config.port, proxy_cmd = \
self.config.host, username_from_config, self.config.port, proxy_cmd = \
self._read_login_ssh_config(hostname, username, self.config.port, proxy_cmd)
if not username or username == b'None':
username = username_from_config
Comment on lines +887 to +890
Comment on lines +889 to +890

sock_tunnel = None

Expand Down