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