# HG changeset patch # User Marcin Kuzminski # Date 2017-11-06 10:13:05 # Node ID 1517e3b2c49488f837903331e6d6275b18ddfc25 # Parent 8863592ac0145533b4a792269aa29f8d2a501e76 ssh: always expand the path for the generated authorized_keys file. Without it we can lead to path problems on reading the ~. diff --git a/rhodecode/apps/ssh_support/utils.py b/rhodecode/apps/ssh_support/utils.py --- a/rhodecode/apps/ssh_support/utils.py +++ b/rhodecode/apps/ssh_support/utils.py @@ -50,6 +50,9 @@ def get_all_active_keys(): def _generate_ssh_authorized_keys_file( authorized_keys_file_path, ssh_wrapper_cmd, allow_shell, ssh_opts, debug): + authorized_keys_file_path = os.path.abspath( + os.path.expanduser(authorized_keys_file_path)) + import rhodecode all_active_keys = get_all_active_keys() @@ -59,6 +62,7 @@ def _generate_ssh_authorized_keys_file( ssh_wrapper_cmd = ssh_wrapper_cmd + ' --debug' if not os.path.isfile(authorized_keys_file_path): + log.debug('Creating file at %s', authorized_keys_file_path) with open(authorized_keys_file_path, 'w'): pass