From 50617a9f0571eb18ac821abe3fcf35f1da685813 Mon Sep 17 00:00:00 2001 From: Faiyaz Ahmed Date: Mon, 28 Jul 2008 19:43:57 +0000 Subject: [PATCH] Chown .ssh to user:slices. SSH will bail otherwise. --- accounts.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/accounts.py b/accounts.py index 012c040..3065408 100644 --- a/accounts.py +++ b/accounts.py @@ -23,6 +23,7 @@ maximum stack size. import Queue import os import pwd +from grp import getgrnam import threading import logger @@ -89,8 +90,11 @@ class Account: if not os.access(dot_ssh, os.F_OK): os.mkdir(dot_ssh) os.chmod(dot_ssh, 0700) tools.write_file(dot_ssh + '/authorized_keys', lambda f: f.write(new_keys)) - logger.verbose('%s: installing ssh keys' % self.name) - os.chown(dot_ssh + '/authorized_keys', pwd.getpwnam(self.name)[2], 504) + logger.log('%s: installing ssh keys' % self.name) + user = pwd.getpwnam(self.name)[2] + group = getgrnam("slices")[2] + os.chown(dot_ssh, user, group) + os.chown(dot_ssh + '/authorized_keys', user, group) def start(self, delay=0): pass def stop(self): pass -- 2.43.0