From d176935fb7660ba8332a9f41b487ac4e12cff869 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Tue, 19 Nov 2019 00:06:35 +0500 Subject: [PATCH] bug fix: change ssh password for ubuntu --- websiteFunctions/website.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/websiteFunctions/website.py b/websiteFunctions/website.py index b3a32ec80..986c9f2e5 100755 --- a/websiteFunctions/website.py +++ b/websiteFunctions/website.py @@ -2474,7 +2474,13 @@ StrictHostKeyChecking no website = Websites.objects.get(domain=self.domain) - command = 'echo "%s" | passwd --stdin %s' % (data['password'], data['externalApp']) + uBuntuPath = '/etc/lsb-release' + + if os.path.exists(uBuntuPath): + command = "echo '%s:%s' | chpasswd" % (data['externalApp'], data['password']) + else: + command = 'echo "%s" | passwd --stdin %s' % (data['password'], data['externalApp']) + ProcessUtilities.executioner(command) data_ret = {'status': 1, 'error_message': 'None'}