# HG changeset patch # User Mads Kiilerich # Date 1577580198 -3600 # Node ID 74b7aa45c1e15e239d1999b206f003f74033f750 # Parent ba6418fde72f286a95f207fb14eeeee2ac788a55 ssh: add WARNING comment as first line in .authorized_keys managed by Kallithea diff -r ba6418fde72f -r 74b7aa45c1e1 kallithea/model/ssh_key.py --- a/kallithea/model/ssh_key.py Sun Dec 29 01:41:47 2019 +0100 +++ b/kallithea/model/ssh_key.py Sun Dec 29 01:43:18 2019 +0100 @@ -129,6 +129,7 @@ fh, tmp_authorized_keys = tempfile.mkstemp('.authorized_keys', dir=os.path.dirname(authorized_keys)) with os.fdopen(fh, 'w') as f: + f.write("# WARNING: This .ssh/authorized_keys file is managed by Kallithea. Manual editing or adding new entries will make Kallithea back off.\n") for key in UserSshKeys.query().join(UserSshKeys.user).filter(User.active == True): f.write(ssh.authorized_keys_line(kallithea_cli_path, config['__file__'], key)) os.chmod(tmp_authorized_keys, stat.S_IRUSR | stat.S_IWUSR)