<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.nixos.org/w/index.php?action=history&amp;feed=atom&amp;title=SSH</id>
	<title>SSH - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.nixos.org/w/index.php?action=history&amp;feed=atom&amp;title=SSH"/>
	<link rel="alternate" type="text/html" href="https://wiki.nixos.org/w/index.php?title=SSH&amp;action=history"/>
	<updated>2026-04-04T04:40:12Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.0</generator>
	<entry>
		<id>https://wiki.nixos.org/w/index.php?title=SSH&amp;diff=23838&amp;oldid=prev</id>
		<title>Oluceps: /* Security hardening */</title>
		<link rel="alternate" type="text/html" href="https://wiki.nixos.org/w/index.php?title=SSH&amp;diff=23838&amp;oldid=prev"/>
		<updated>2025-07-27T13:03:39Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Security hardening&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 13:03, 27 July 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l44&quot;&gt;Line 44:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 44:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   services.openssh = {&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   services.openssh = {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     enable = true;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     enable = true;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Ports &lt;/del&gt;= [ 5432 ];&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ports &lt;/ins&gt;= [ 5432 ];&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     settings = {&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     settings = {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;       PasswordAuthentication = false;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;       PasswordAuthentication = false;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Oluceps</name></author>
	</entry>
	<entry>
		<id>https://wiki.nixos.org/w/index.php?title=SSH&amp;diff=23837&amp;oldid=prev</id>
		<title>Jnalley: Added missing semicolon</title>
		<link rel="alternate" type="text/html" href="https://wiki.nixos.org/w/index.php?title=SSH&amp;diff=23837&amp;oldid=prev"/>
		<updated>2025-07-26T20:34:02Z</updated>

		<summary type="html">&lt;p&gt;Added missing semicolon&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 20:34, 26 July 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l49&quot;&gt;Line 49:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 49:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;       KbdInteractiveAuthentication = false;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;       KbdInteractiveAuthentication = false;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;       PermitRootLogin = &amp;quot;no&amp;quot;;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;       PermitRootLogin = &amp;quot;no&amp;quot;;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;       AllowUsers = [ &quot;myUser&quot; ]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;       AllowUsers = [ &quot;myUser&quot; ]&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     };&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     };&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   };&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   };&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/nowiki&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/nowiki&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|name=|lang=&lt;/ins&gt;}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In addition to these settings, consider enabling [[#Fail2Ban|Fail2Ban]] as a recommended baseline for security.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In addition to these settings, consider enabling [[#Fail2Ban|Fail2Ban]] as a recommended baseline for security.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key mediawiki:diff:1.41:old-21426:rev-23837:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Jnalley</name></author>
	</entry>
	<entry>
		<id>https://wiki.nixos.org/w/index.php?title=SSH&amp;diff=21426&amp;oldid=prev</id>
		<title>Pigs: Create ssh page, detail server and client configuration</title>
		<link rel="alternate" type="text/html" href="https://wiki.nixos.org/w/index.php?title=SSH&amp;diff=21426&amp;oldid=prev"/>
		<updated>2025-05-13T17:04:20Z</updated>

		<summary type="html">&lt;p&gt;Create ssh page, detail server and client configuration&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[https://en.wikipedia.org/wiki/Secure_Shell SSH (Secure Shell)] is a protocol for securely accessing remote machines over an unsecured network. It is commonly used for remote administration, file transfers, and secure tunneling.&lt;br /&gt;
&lt;br /&gt;
This page covers the setup and management of SSH on NixOS systems. NixOS primarily uses [https://www.openssh.com/ OpenSSH] for both server and client functionality.&lt;br /&gt;
&lt;br /&gt;
For more manual-level information, refer to the {{NixOS Manual|name=NixOS Manual: Chapter - Secure Shell Access|anchor=#sec-ssh}}.&lt;br /&gt;
&lt;br /&gt;
{{Security Warning|Changing SSH configuration settings can significantly impact the security of your system(s). It is crucial to have a solid understanding of what you are doing before making any adjustments.&lt;br /&gt;
&lt;br /&gt;
Avoid blindly copying and pasting examples, including those from this Wiki page, without conducting a thorough analysis. Failure to do so may compromise the security of your system(s) and lead to potential vulnerabilities.&lt;br /&gt;
Take the time to comprehend the implications of your actions and ensure that any changes made are done thoughtfully and with care.}}&lt;br /&gt;
&lt;br /&gt;
= OpenSSH Server =&lt;br /&gt;
&lt;br /&gt;
To enable a SSH service, add the following to your system configuration: &lt;br /&gt;
&lt;br /&gt;
{{file|/etc/nixos/configuration.nix|nix|&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
  services.openssh = {&lt;br /&gt;
    enable = true;&lt;br /&gt;
  };&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
By default, the server listens on port 22 and allows password authentication. Note that the port defined in the &amp;lt;code&amp;gt;openssh&amp;lt;/code&amp;gt; config is opened automatically in the [[Firewall|firewall]].&lt;br /&gt;
&lt;br /&gt;
For more SSH server configuration options, refer to the {{nixos:option|services.openssh}} module options.&lt;br /&gt;
&lt;br /&gt;
== Security hardening ==&lt;br /&gt;
&lt;br /&gt;
To improve the security of your SSH server, it is recommended to apply the following measures:&lt;br /&gt;
&lt;br /&gt;
* Disable password-based login&lt;br /&gt;
&lt;br /&gt;
* Disable root login&lt;br /&gt;
&lt;br /&gt;
* Restrict allowed users&lt;br /&gt;
&lt;br /&gt;
* Change the default port&lt;br /&gt;
&lt;br /&gt;
These options can be configured declaratively in your system configuration:&lt;br /&gt;
&lt;br /&gt;
{{file|/etc/nixos/configuration.nix|nix|&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
  services.openssh = {&lt;br /&gt;
    enable = true;&lt;br /&gt;
    Ports = [ 5432 ];&lt;br /&gt;
    settings = {&lt;br /&gt;
      PasswordAuthentication = false;&lt;br /&gt;
      KbdInteractiveAuthentication = false;&lt;br /&gt;
      PermitRootLogin = &amp;quot;no&amp;quot;;&lt;br /&gt;
      AllowUsers = [ &amp;quot;myUser&amp;quot; ]&lt;br /&gt;
    };&lt;br /&gt;
  };&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
In addition to these settings, consider enabling [[#Fail2Ban|Fail2Ban]] as a recommended baseline for security.&lt;br /&gt;
&lt;br /&gt;
= SSH client configuration =&lt;br /&gt;
&lt;br /&gt;
The OpenSSH client is available by default on NixOS and can be configured using the {{nixos:option|programs.ssh}} module options.&lt;br /&gt;
&lt;br /&gt;
{{file|/etc/nixos/configuration.nix|nix|&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
  programs.ssh = {&lt;br /&gt;
    extraConfig = &amp;quot;&lt;br /&gt;
      Host myhost&lt;br /&gt;
        Hostname 192.168.1.123&lt;br /&gt;
        Port 22&lt;br /&gt;
        User user&lt;br /&gt;
    &amp;quot;;&lt;br /&gt;
  };&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This allows you to connect using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;&lt;br /&gt;
$ ssh myhost&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|Since this is a system-wide configuration, you cannot specify a user-specific identity file here due to file permission constraints.}}&lt;br /&gt;
&lt;br /&gt;
For per-user SSH configuration, consider using [[Home Manager]] with the [https://home-manager-options.extranix.com/?query=programs.ssh programs.ssh] options, which allow for more flexible, user-level SSH client settings. &lt;br /&gt;
&lt;br /&gt;
Alternatively, you can manually manage SSH client configuration by placing entries in the user-specific &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
= SSH public key authentication =&lt;br /&gt;
&lt;br /&gt;
For details on configuring public key authentication, managing SSH keys, and setting up SSH agents, see the dedicated page: [[SSH public key authentication]].&lt;br /&gt;
&lt;br /&gt;
= Tips and tricks =&lt;br /&gt;
&lt;br /&gt;
== Fail2Ban ==&lt;br /&gt;
&lt;br /&gt;
{{main|Fail2ban}} &lt;br /&gt;
&lt;br /&gt;
[http://www.fail2ban.org/ Fail2Ban] is a service that bans hosts that cause multiple authentication errors.&lt;br /&gt;
&lt;br /&gt;
To enable Fail2Ban, add the following to your system configuration:&lt;br /&gt;
&lt;br /&gt;
{{file|/etc/nixos/configuration.nix|nix|&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
  services.fail2ban.enable = true;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Endlessh ==&lt;br /&gt;
&lt;br /&gt;
[https://github.com/skeeto/endlessh Endlessh] is a SSH tarpit that slows down malicious or automated SSH connection attempts by indefinitely delaying connections.&lt;br /&gt;
&lt;br /&gt;
To enable Endlessh, add the following to your system configuration:&lt;br /&gt;
&lt;br /&gt;
{{file|/etc/nixos/configuration.nix|nix|&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
  services.endlessh = {&lt;br /&gt;
    enable = true;&lt;br /&gt;
    port = 22;&lt;br /&gt;
    openFirewall = true;&lt;br /&gt;
  };&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
For additional configuration options, see the{{nixos:option|services.endlessh}} module documentation.&lt;br /&gt;
&lt;br /&gt;
= See also = &lt;br /&gt;
&lt;br /&gt;
* [[SSH public key authentication]]&lt;br /&gt;
* [[Fail2ban]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Networking]]&lt;br /&gt;
[[Category:Server]]&lt;/div&gt;</summary>
		<author><name>Pigs</name></author>
	</entry>
</feed>