git://git.onelab.eu
/
nodemanager.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
dbf1f94
)
Chown .ssh to user:slices. SSH will bail otherwise.
author
Faiyaz Ahmed
<faiyaza@cs.princeton.edu>
Mon, 28 Jul 2008 19:43:57 +0000
(19:43 +0000)
committer
Faiyaz Ahmed
<faiyaza@cs.princeton.edu>
Mon, 28 Jul 2008 19:43:57 +0000
(19:43 +0000)
accounts.py
patch
|
blob
|
history
diff --git
a/accounts.py
b/accounts.py
index
012c040
..
3065408
100644
(file)
--- a/
accounts.py
+++ b/
accounts.py
@@
-23,6
+23,7
@@
maximum stack size.
import Queue
import os
import pwd
import Queue
import os
import pwd
+from grp import getgrnam
import threading
import logger
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))
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
def start(self, delay=0): pass
def stop(self): pass