Commit a8ce62c9 by Bach Dániel

cleanup: remove ssh host keys

fixes #2
parent 8176e5e0
...@@ -12,6 +12,7 @@ import fileinput ...@@ -12,6 +12,7 @@ import fileinput
import platform import platform
import sys import sys
import tarfile import tarfile
from glob import glob
from StringIO import StringIO from StringIO import StringIO
from base64 import decodestring from base64 import decodestring
from shutil import rmtree, move from shutil import rmtree, move
...@@ -153,14 +154,22 @@ class Context(object): ...@@ -153,14 +154,22 @@ class Context(object):
@staticmethod @staticmethod
def cleanup(): def cleanup():
if system == 'Linux': if system == 'Linux':
filelist = ( filelist = ((
'/root/.bash_history' '/root/.bash_history'
'/home/cloud/.bash_history' '/home/cloud/.bash_history'
'/root/.ssh' '/root/.ssh'
'/home/cloud/.ssh') '/home/cloud/.ssh')
+ glob('/etc/ssh/ssh_host_*'))
for f in filelist: for f in filelist:
rmtree(f, ignore_errors=True) rmtree(f, ignore_errors=True)
if distro == 'debian':
subprocess.call(('/usr/sbin/dpkg-reconfigure',
'openssh-server'))
elif distro == 'rhel':
# TODO
pass
elif system == 'Windows': elif system == 'Windows':
# TODO # TODO
pass pass
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment