khaclep007

sshd_config

Oct 17th, 2021 (edited)
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.34 KB | None | 0 0
  1. # This is the sshd server system-wide configuration file. See
  2. # sshd_config(5) for more information.
  3.  
  4. # This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin
  5.  
  6. # The strategy used for options in the default sshd_config shipped with
  7. # OpenSSH is to specify options with their default value where
  8. # possible, but leave them commented. Uncommented options change a
  9. # default value.
  10.  
  11. Port 22
  12. #AddressFamily any
  13. #ListenAddress 0.0.0.0
  14. #ListenAddress ::
  15.  
  16. # The default requires explicit activation of protocol 1
  17. #Protocol 2
  18.  
  19. # HostKey for protocol version 1
  20. #HostKey /etc/ssh/ssh_host_key
  21. # HostKeys for protocol version 2
  22. #HostKey /etc/ssh/ssh_host_rsa_key
  23. #HostKey /etc/ssh/ssh_host_dsa_key
  24. #HostKey /etc/ssh/ssh_host_ecdsa_key
  25.  
  26. # Lifetime and size of ephemeral version 1 server key
  27. #KeyRegenerationInterval 1h
  28. #ServerKeyBits 1024
  29.  
  30. # Logging
  31. # obsoletes QuietMode and FascistLogging
  32. #SyslogFacility AUTH
  33. #LogLevel INFO
  34.  
  35. # Authentication:
  36.  
  37. #LoginGraceTime 2m
  38. #BC# Root only allowed to login from LAN IP ranges listed at end
  39. PermitRootLogin yes
  40. #PermitRootLogin yes
  41. #StrictModes yes
  42. #MaxAuthTries 6
  43. #MaxSessions 10
  44.  
  45. #RSAAuthentication yes
  46. #PubkeyAuthentication yes
  47. #AuthorizedKeysFile .ssh/authorized_keys
  48.  
  49. # For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
  50. #RhostsRSAAuthentication no
  51. # similar for protocol version 2
  52. #HostbasedAuthentication no
  53. # Change to yes if you don't trust ~/.ssh/known_hosts for
  54. # RhostsRSAAuthentication and HostbasedAuthentication
  55. #IgnoreUserKnownHosts no
  56. # Don't read the user's ~/.rhosts and ~/.shosts files
  57. #IgnoreRhosts yes
  58.  
  59. # To disable tunneled clear text passwords, change to no here!
  60. #BC# Disable password authentication by default (except for LAN IP ranges listed later)
  61. PasswordAuthentication yes
  62. PermitEmptyPasswords no
  63. #BC# Have to allow root here because AllowUsers not allowed in Match block. It will not work though because of PermitRootLogin.
  64. #BC# This is no longer true as of 6.1. AllowUsers is now allowed in a Match block.
  65. AllowUsers kmk root
  66.  
  67. # Change to no to disable s/key passwords
  68. #BC# I occasionally use s/key one time passwords generated by a phone app
  69. ChallengeResponseAuthentication yes
  70.  
  71. # Kerberos options
  72. #KerberosAuthentication no
  73. #KerberosOrLocalPasswd yes
  74. #KerberosTicketCleanup yes
  75. #KerberosGetAFSToken no
  76.  
  77. # GSSAPI options
  78. #GSSAPIAuthentication no
  79. #GSSAPICleanupCredentials yes
  80.  
  81. # Set this to 'yes' to enable PAM authentication, account processing,
  82. # and session processing. If this is enabled, PAM authentication will
  83. # be allowed through the ChallengeResponseAuthentication and
  84. # PasswordAuthentication. Depending on your PAM configuration,
  85. # PAM authentication via ChallengeResponseAuthentication may bypass
  86. # the setting of "PermitRootLogin without-password".
  87. # If you just want the PAM account and session checks to run without
  88. # PAM authentication, then enable this but set PasswordAuthentication
  89. # and ChallengeResponseAuthentication to 'no'.
  90. #BC# I would turn this off but I compiled ssh without PAM support so it errors if I set this.
  91. #UsePAM no
  92.  
  93. #AllowAgentForwarding yes
  94. #AllowTcpForwarding yes
  95. #GatewayPorts no
  96. X11Forwarding yes
  97. #X11DisplayOffset 10
  98. #X11UseLocalhost yes
  99. #PrintMotd yes
  100. #PrintLastLog yes
  101. #TCPKeepAlive yes
  102. #UseLogin no
  103. #UsePrivilegeSeparation yes
  104. #PermitUserEnvironment no
  105. #Compression delayed
  106. #ClientAliveInterval 0
  107. #ClientAliveCountMax 3
  108. #UseDNS yes
  109. #PidFile /var/run/sshd.pid
  110. #MaxStartups 10
  111. #PermitTunnel no
  112. #ChrootDirectory none
  113.  
  114. # no default banner path
  115. #Banner none
  116.  
  117. # override default of no subsystems
  118. #Subsystem sftp /usr/lib/misc/sftp-server
  119. Subsystem sftp internal-sftp
  120.  
  121. # the following are HPN related configuration options
  122. # tcp receive buffer polling. disable in non autotuning kernels
  123. #TcpRcvBufPoll yes
  124.  
  125. # allow the use of the none cipher
  126. #NoneEnabled no
  127.  
  128. # disable hpn performance boosts.
  129. #HPNDisabled no
  130.  
  131. # buffer size for hpn to non-hpn connections
  132. #HPNBufferSize 2048
  133.  
  134.  
  135. # Example of overriding settings on a per-user basis
  136. #Match User anoncvs
  137. # X11Forwarding no
  138. # AllowTcpForwarding no
  139. # ForceCommand cvs server
  140.  
  141. #BC# My internal networks
  142. #BC# Root can log in from here but only with a key and kmk can log in here with a password.
  143. Match Address 172.22.100.0/24,172.22.5.0/24,127.0.0.1
  144. PermitRootLogin without-password
  145. PasswordAuthentication yes
Add Comment
Please, Sign In to add comment