changeset 8088:74b7aa45c1e1 stable

ssh: add WARNING comment as first line in .authorized_keys managed by Kallithea
author Mads Kiilerich <mads@kiilerich.com>
date Sun, 29 Dec 2019 01:43:18 +0100
parents ba6418fde72f
children 1eca0ed41a6e
files kallithea/model/ssh_key.py
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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)