Saltstack Official OpenSSH Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

92 lines
4.8KB

  1. # This file is managed by salt. Manual changes risk being overwritten.
  2. # The contents of the original sshd_config are kept on the bottom for
  3. # quick reference.
  4. # See the sshd_config(5) manpage for details
  5. # What ports, IPs and protocols we listen for
  6. Port {{ salt['pillar.get']('sshd_config:Port','22') }}
  7. # Use these options to restrict which interfaces/protocols sshd will bind to
  8. #ListenAddress ::
  9. ListenAddress {{ salt['pillar.get']('sshd_config:ListenAddress','0.0.0.0') }}
  10. Protocol {{ salt['pillar.get']('sshd_config:Protocol','2') }}
  11. # HostKeys for protocol version 2
  12. {% for host_key in salt['pillar.get']('sshd_config:',['/etc/ssh/ssh_host_rsa_key','/etc/ssh/ssh_host_dsa_key','/etc/ssh/ssh_host_ecdsa_key']) %}
  13. HostKey {{ host_key }}
  14. {% endfor %}
  15. #Privilege Separation is turned on for security
  16. UsePrivilegeSeparation {{ salt['pillar.get']('sshd_config:UsePrivilegeSeparation','yes') }}
  17. # Lifetime and size of ephemeral version 1 server key
  18. KeyRegenerationInterval {{ salt['pillar.get']('sshd_config:KeyRegenerationInterval','3600') }}
  19. ServerKeyBits {{ salt['pillar.get']('sshd_config:ServerKeyBits','768') }}
  20. # Logging
  21. SyslogFacility {{ salt['pillar.get']('sshd_config:SyslogFacility','AUTH') }}
  22. LogLevel {{ salt['pillar.get']('sshd_config:LogLevel','INFO') }}
  23. # Authentication:
  24. LoginGraceTime {{ salt['pillar.get']('sshd_config:LoginGracetime','120') }}
  25. PermitRootLogin {{ salt['pillar.get']('sshd_config:PermitRootLogin','no') }}
  26. StrictModes {{ salt['pillar.get']('sshd_config:StrictModes','yes') }}
  27. RSAAuthentication {{ salt['pillar.get']('sshd_config:RSAAuthentication','yes') }}
  28. PubkeyAuthentication {{ salt['pillar.get']('sshd_config:PubkeyAuthentication','yes') }}
  29. AuthorizedKeysFile {{ salt['pillar.get']('sshd_config:AuthorizedKeysFile','%h/.ssh/authorized_keys') }}
  30. # Don't read the user's ~/.rhosts and ~/.shosts files
  31. IgnoreRhosts {{ salt['pillar.get']('sshd_config:IgnoreRhosts','yes') }}
  32. # For this to work you will also need host keys in /etc/ssh_known_hosts
  33. RhostsRSAAuthentication {{ salt['pillar.get']('sshd_config:RhostsRSAAuthentication','no') }}
  34. # similar for protocol version 2
  35. HostbasedAuthentication {{ salt['pillar.get']('sshd_config:HostbasedAuthentication','no') }}
  36. # Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
  37. IgnoreUserKnownHosts {{ salt['pillar.get']('sshd_config:IgnoreUserKnownHosts','yes') }}
  38. # To enable empty passwords, change to yes (NOT RECOMMENDED)
  39. PermitEmptyPasswords {{ salt['pillar.get']('sshd_config:PermitEmptyPasswords','no') }}
  40. # Change to yes to enable challenge-response passwords (beware issues with
  41. # some PAM modules and threads)
  42. ChallengeResponseAuthentication {{ salt['pillar.get']('sshd_config:ChallengeResponseAuthentication','no') }}
  43. # Change to no to disable tunnelled clear text passwords
  44. PasswordAuthentication {{ salt['pillar.get']('sshd_config:PasswordAuthentication','yes') }}
  45. # Kerberos options
  46. KerberosAuthentication {{ salt['pillar.get']('sshd_config:KerberosAuthentication','no') }}
  47. KerberosGetAFSToken {{ salt['pillar.get']('sshd_config:KerberosGetAFSToken','no') }}
  48. KerberosOrLocalPasswd {{ salt['pillar.get']('sshd_config:KerberosOrLocalPasswd','yes') }}
  49. KerberosTicketCleanup {{ salt['pillar.get']('sshd_config:KerberosTicketCleanup','yes') }}
  50. # GSSAPI options
  51. GSSAPIAuthentication {{ salt['pillar.get']('sshd_config:GSSAPIAuthentication','no') }}
  52. GSSAPICleanupCredentials {{ salt['pillar.get']('sshd_config:GSSAPICleanupCredentials','yes') }}
  53. X11Forwarding {{ salt['pillar.get']('sshd_config:X11Forwarding','yes') }}
  54. X11DisplayOffset {{ salt['pillar.get']('sshd_config:X11DisplayOffset','10') }}
  55. PrintMotd {{ salt['pillar.get']('sshd_config:PrintMotd','no') }}
  56. PrintLastLog {{ salt['pillar.get']('sshd_config:PrintLastLog','yes') }}
  57. TCPKeepAlive {{ salt['pillar.get']('sshd_config:TCPKeepAlive','yes') }}
  58. UseLogin {{ salt['pillar.get']('sshd_config:UseLogin','no') }}
  59. MaxStartups {{ salt['pillar.get']('sshd_config:MaxStartups','10:30:60') }}
  60. Banner {{ salt['pillar.get']('sshd_config:Banner','/etc/issue.net') }}
  61. # Allow client to pass locale environment variables
  62. AcceptEnv {{ salt['pillar.get']('sshd_config:AcceptEnv','LANG LC_*') }}
  63. Subsystem {{ salt['pillar.get']('sshd_config:Subsystem','sftp /usr/lib/openssh/sftp-server') }}
  64. # Set this to 'yes' to enable PAM authentication, account processing,
  65. # and session processing. If this is enabled, PAM authentication will
  66. # be allowed through the ChallengeResponseAuthentication and
  67. # PasswordAuthentication. Depending on your PAM configuration,
  68. # PAM authentication via ChallengeResponseAuthentication may bypass
  69. # the setting of "PermitRootLogin without-password".
  70. # If you just want the PAM account and session checks to run without
  71. # PAM authentication, then enable this but set PasswordAuthentication
  72. # and ChallengeResponseAuthentication to 'no'.
  73. UsePAM {{ salt['pillar.get']('sshd_config:UsePAM','yes') }}