added sshd config to setup

This commit is contained in:
2025-05-15 09:14:17 -04:00
parent 384c151435
commit 3798f2b2d5
3 changed files with 52 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
#!/usr/bin/env bash
script_dir=$(dirname "$0")
# ----------------------------------------------------------
read -p 'Setup secure "sshd_config" file? [y/N]: ' response
case "${response}" in
[Yy]* )
mkdir -p "/etc/ssh/sshd_config.d"
sudo mv "/etc/ssh/sshd_config" "/etc/ssh/sshd_config.backup"
sudo cp "${script_dir}/config/sshd-sshd_config.conf" "/etc/ssh/sshd_config.d/sshd_config.conf"
sudo cp "${script_dir}/config/sshd-include.conf" "/etc/ssh/sshd_config"
;;
* )
echo 'Skipping'
;;
esac
echo ''
# ----------------------------------------------------------
read -p 'Restart SSH to use updated config? [y/N]: ' response
case "${response}" in
[Yy]* )
sudo systemctl restart ssh.service
echo -e "\e[33mremember to test ssh, ensure root login block, ensure user enaled"
;;
* )
echo 'Skipping'
;;
esac
echo ''
+3
View File
@@ -0,0 +1,3 @@
# comment
Include /etc/ssh/sshd_config.d/*.conf
+15
View File
@@ -0,0 +1,15 @@
# comment
AuthenticationMethods publickey
PubkeyAuthentication yes
PermitRootLogin no
PasswordAuthentication no
ChallengeResponseAuthentication no
UsePAM yes
LogLevel VERBOSE
X11Forwarding yes
PrintMotd no
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server