diff --git a/rhodecode/apps/admin/views/users.py b/rhodecode/apps/admin/views/users.py index 2de12237..ff0891cc 100644 --- a/rhodecode/apps/admin/views/users.py +++ b/rhodecode/apps/admin/views/users.py @@ -826,7 +826,7 @@ class UsersView(UserAppView): fingerprint = key.hash_md5() ssh_key = SshKeyModel().create( - c.user.user_id, fingerprint, key_data, description) + c.user.user_id, fingerprint, key.keydata, description) ssh_key_data = ssh_key.get_api_data() audit_logger.store_web( diff --git a/rhodecode/apps/my_account/views/my_account_ssh_keys.py b/rhodecode/apps/my_account/views/my_account_ssh_keys.py index 78036171..70865d51 100644 --- a/rhodecode/apps/my_account/views/my_account_ssh_keys.py +++ b/rhodecode/apps/my_account/views/my_account_ssh_keys.py @@ -98,7 +98,7 @@ class MyAccountSshKeysView(BaseAppView, DataGridAppView): fingerprint = key.hash_md5() ssh_key = SshKeyModel().create( - c.user.user_id, fingerprint, key_data, description) + c.user.user_id, fingerprint, key.keydata, description) ssh_key_data = ssh_key.get_api_data() audit_logger.store_web( diff --git a/rhodecode/apps/ssh_support/utils.py b/rhodecode/apps/ssh_support/utils.py index 4cce26cd..5b2129e0 100644 --- a/rhodecode/apps/ssh_support/utils.py +++ b/rhodecode/apps/ssh_support/utils.py @@ -87,7 +87,8 @@ def _generate_ssh_authorized_keys_file( # replace all newline from ends and inside safe_key_data = user_key.ssh_key_data\ .strip()\ - .replace('\n', ' ')\ + .replace('\n', ' ') \ + .replace('\t', ' ') \ .replace('\r', ' ') line = line_tmpl.format(