Browse Source

Merge pull request #28 from aboe76/allow_deny_users

Added AllowUsers,AllowGroups,DenyUsers,DenyGroups
master
Nitin Madhok 10 years ago
parent
commit
4e49e73e76
2 changed files with 24 additions and 0 deletions
  1. +19
    -0
      openssh/files/sshd_config
  2. +5
    -0
      pillar.example

+ 19
- 0
openssh/files/sshd_config View File

# DNS resolve and map remote IP addresses # DNS resolve and map remote IP addresses
{{ option('UseDNS', 'yes') }} {{ option('UseDNS', 'yes') }}


# Restricting Users and Hosts
# example:
# AllowUsers vader@10.0.0.1 maul@sproing.evil.com luke
# AllowGroups wheel staff
#
# Keep in mind that using AllowUsers or AllowGroups means that anyone
# not Matching one of the supplied patterns will be denied access by default.
# Also, in order for sshd to allow access based on full or partial hostnames it
# needs to to a DNS lookup
#
# DenyUsers
{{ option('DenyUsers', '') }}
# AllowUsers
{{ option('AllowUsers', '') }}
# DenyGroups
{{ option('DenyGroups', '') }}
# AllowGroups
{{ option('AllowGroups', '') }}

{# Handling unknown in salt template options #} {# Handling unknown in salt template options #}
{%- for keyword in sshd_config.keys() %} {%- for keyword in sshd_config.keys() %}
{#- Matches have to be at the bottem and should be handled differently -#} {#- Matches have to be at the bottem and should be handled differently -#}

+ 5
- 0
pillar.example View File

Subsystem: "sftp /usr/lib/openssh/sftp-server" Subsystem: "sftp /usr/lib/openssh/sftp-server"
UsePAM: 'yes' UsePAM: 'yes'
UseDNS: 'yes' UseDNS: 'yes'
AllowUsers: 'vader@10.0.0.1 maul@evil.com sidious luke'
DenyUsers: 'yoda chewbaca@112.10.21.1'
AllowGroups: 'wheel staff imperial'
DenyGroups: 'rebel'
Deny
matches: matches:
sftp_chroot: sftp_chroot:
type: type:

Loading…
Cancel
Save