|
|
|
@ -46,11 +46,13 @@ def install(): |
|
|
|
|
run(r'netsh advfirewall firewall add rule name="OpenSSH Server" dir=in action=allow protocol=TCP localport=22 enable=yes') |
|
|
|
|
|
|
|
|
|
print(' Deploy sshd_config') |
|
|
|
|
conf_dir = makepath(os.getenv('ProgramData',r'C:\ProgramData'),'ssh') |
|
|
|
|
mkdirs(conf_dir) |
|
|
|
|
jinja2 = Environment( |
|
|
|
|
loader=FileSystemLoader('.'), |
|
|
|
|
trim_blocks=True |
|
|
|
|
) |
|
|
|
|
open(makepath(os.getenv('ProgramData',r'C:\ProgramData'),'ssh','sshd_config'),'w').write( |
|
|
|
|
open(makepath(conf_dir,'sshd_config'),'w').write( |
|
|
|
|
jinja2.get_template('sshd_config.j2').render( |
|
|
|
|
ssh_ciphers = ('+' if variables['ssh_append_ciphers'] == True else '') + ','.join(variables['ssh_ciphers']), |
|
|
|
|
ssh_password_auth = variables['ssh_password_auth'] |
|
|
|
|