forked from storopoli/flakes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(linux): desktop SSH access server (storopoli#71)
* feat(linux): desktop SSH access server * fix: openssh is false by default
- Loading branch information
Showing
3 changed files
with
45 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,8 +49,6 @@ | |
services = { | ||
resolved.enable = true; | ||
|
||
openssh.enable = false; | ||
|
||
tor.enable = true; | ||
}; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ config, lib, pkgs, ... }: | ||
|
||
{ | ||
|
||
# Enable SSH server with custom hardened configs | ||
services.openssh = { | ||
enable = true; | ||
|
||
settings = { | ||
# Modern ciphers/MACs | ||
Ciphers = [ | ||
"chacha20-poly1305@openssh.com" | ||
"aes256-gcm@openssh.com" | ||
"aes128-gcm@openssh.com" | ||
"aes256-ctr" | ||
"aes192-ctr" | ||
"aes128-ctr" | ||
]; | ||
Macs = [ | ||
"hmac-sha2-512-etm@openssh.com" | ||
"hmac-sha2-256-etm@openssh.com" | ||
"umac-128-etm@openssh.com" | ||
]; | ||
|
||
# require public key authentication for better security | ||
PasswordAuthentication = false; | ||
KbdInteractiveAuthentication = false; | ||
|
||
# Only for the user `user` | ||
AllowUsers = [ "user" ]; | ||
|
||
LogLevel = "INFO"; | ||
}; | ||
}; | ||
|
||
# Authorized Keys | ||
users.users."user".openssh.authorizedKeys.keys = [ | ||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKU4O0J7gdU1+0/IoVZUtajfmWGGNmA3TFXTsbnQfpwt openpgp:0xC116F831" | ||
]; | ||
|
||
# Open port 22 in Firewall | ||
networking.firewall.allowedTCPPorts = [ 22 ]; | ||
} |