Skip to content

Commit

Permalink
use /run/ssh subdir + harden openssh config a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
miampf committed Jan 2, 2025
1 parent 28da57c commit 05eef85
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Before=sshd.service

[Service]
Type=oneshot
ExecStart=/bin/bash -c "ssh-keygen -t ecdsa -q -N '' -f /run/ssh_host_ecdsa_key"
ExecStart=/bin/bash -c "mkdir -p /run/ssh; ssh-keygen -t ecdsa -q -N '' -f /run/ssh/ssh_host_ecdsa_key"

[Install]
WantedBy=multi-user.target
6 changes: 4 additions & 2 deletions image/sysroot-tree/etc/ssh/sshd_config
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
HostKey /run/ssh_host_ecdsa_key
TrustedUserCAKeys /run/ssh_ca.pub
HostKey /run/ssh/ssh_host_ecdsa_key
TrustedUserCAKeys /run/ssh/ssh_ca.pub
PasswordAuthentication no
ChallengeResponseAuthentication no
AuthorizedKeysFile /dev/null

0 comments on commit 05eef85

Please sign in to comment.