added sshd config to setup
This commit is contained in:
Executable
+34
@@ -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 ''
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
# comment
|
||||
Include /etc/ssh/sshd_config.d/*.conf
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user