You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
They are sometimes useful when you need to have user/group rectrictions or want to override some global configuration options
Signed-off-by: Artem Sidorenko <[email protected]>
*`['ssh-hardening']['ssh']['server']['sftp']['password_authentication']` - `false`. Set to `true` if password authentication should be enabled
80
80
*`['ssh-hardening']['ssh']['server']['authorized_keys_path']` - `nil`. If not nil, full path to an authorized keys folder is expected
81
81
*`['ssh-hardening']['ssh']['server']['extras']` - `{}`. Add extra configuration options, see [below](#extra-configuration-options) for details
82
+
*`['ssh-hardening']['ssh']['server']['match_blocks']` - `{}`. Match configuration block, see [below](#match-configuration-options-for-sshd) for details
82
83
83
84
## Usage
84
85
@@ -145,6 +146,24 @@ default['ssh-hardening']['ssh']['client']['extras'].tap do |extra|
145
146
end
146
147
```
147
148
149
+
## Match Configuration Options for sshd
150
+
Match blocks have to be placed by the end of sshd_config. This can be achieved by using the `match_blocks` attribute tree:
151
+
152
+
```
153
+
default['ssh-hardening']['ssh']['server']['match_blocks'].tap do |match|
154
+
match['User root'] = <<~ROOT
155
+
AuthorizedKeysFile .ssh/authorized_keys
156
+
ROOT
157
+
match['User git'] = <<~GIT
158
+
Banner none
159
+
AuthorizedKeysCommand /bin/false
160
+
AuthorizedKeysFile .ssh/authorized_keys
161
+
GSSAPIAuthentication no
162
+
PasswordAuthentication no
163
+
GIT
164
+
end
165
+
```
166
+
148
167
## Local Testing
149
168
150
169
Please install [chef-dk](https://downloads.chef.io/chefdk), [VirtualBox](https://www.virtualbox.org/) or VMware Workstation and [Vagrant](https://www.vagrantup.com/).
0 commit comments