Chef cookbook which installs and configures freesshd on windows.
- install freesshd
- configure ssh server
- configure user access, password and key-based
Tested on Windows 7 x64, but should work on any version.
Attribute names follow official names from FreeSSHDService.ini. Defaults are the same as installer would create.
node[:freesshd][:ssh][:SSHListenAddress]
- Default: "0.0.0.0"node[:freesshd][:ssh][:SSHListenPort]
- Default: 22node[:freesshd][:ssh][:SSHMaxConnections]
- Default: 0node[:freesshd][:ssh][:SSHTimeout]
- Default: 0node[:freesshd][:ssh][:SSHBanner]
- Default: ""node[:freesshd][:ssh][:SSHCMD]
- Default: "C:\Windows\system32\cmd.exe"node[:freesshd][:ssh][:SSHRun]
- Default: 1node[:freesshd][:ssh][:SSHNewConsole]
- Default: 1node[:freesshd][:ssh][:SSHCiphers]
- Default: 0node[:freesshd][:ssh][:SSHMACs]
- Default: 65535node[:freesshd][:ssh][:SSHPasswordAuth]
- Default: 0node[:freesshd][:ssh][:SSHPublickeyAuth]
- Default: 0node[:freesshd][:ssh][:SSHPublickeyPath]
- Default: 'C:\Program Files (x86)\freeSSHd'node[:freesshd][:ssh][:RSAKeyPath]
- Default: 'C:\Program Files (x86)\freeSSHd\RSAKey.cfg'node[:freesshd][:ssh][:DSAKeyPath]
- Default: 'C:\Program Files (x86)\freeSSHd\DSAKey.cfg'
Include freesshd
in your node's run_list
:
{
"run_list": [
"recipe[freesshd::default]"
]
}
This will install freesshd and windows service with default configuration. Use chef attributes to customize.
All attributes under node[:freesshd][[:users]
control access to the server.
Examples:
- add user
admin
with password-only authentication, enabled access to shell, with password 'Admin':
node[:freesshd][:users][:admin] = {
auth: 1,
password: '4E7AFEBCFBAE000B22C7C85E5560F89A2A0280B4EC',# Admin
domain: nil,
shell: 1,
sftp: 0,
tunnel: 0
}
More human-friendly attribute types (e.g. true
instead of 1).
Entire sshd is controlled by one single .ini file. Currently only ssh server and users section is controlled by this cookbook. Additionally we could have configurable:
- telnet
- sftp
- logging
License:: MIT Author:: Tomasz Setkowski ([email protected])