address some security concerns

This commit is contained in:
usmannasir
2024-11-03 14:09:52 +05:00
parent d83c5a998d
commit ba0831f626
4 changed files with 23 additions and 12 deletions

View File

@@ -6623,11 +6623,15 @@ StrictHostKeyChecking no
key = data['key']
pathToKeyFile = "/home/%s/.ssh/authorized_keys" % (domain)
website = Websites.objects.get(domain=domain)
command = f'chown {website.externalApp}:{website.externalApp} {pathToKeyFile}'
ProcessUtilities.outputExecutioner(command)
execPath = "/usr/local/CyberCP/bin/python " + virtualHostUtilities.cyberPanel + "/plogical/firewallUtilities.py"
execPath = execPath + " deleteSSHKey --key '%s' --path %s" % (key, pathToKeyFile)
output = ProcessUtilities.outputExecutioner(execPath)
output = ProcessUtilities.outputExecutioner(execPath, website.externalApp)
if output.find("1,None") > -1:
final_dic = {'status': 1, 'delete_status': 1}