Bash_Scripts/SSH/SSH-Configuration.bash

39 lines
1.4 KiB
Bash
Executable File

#!/bin/bash --posix
sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.back
cat << 'EOF' | sudo tee "/etc/ssh/banner"
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Orion Technologies - Security Notice ┃
┃ ------------------------------------ ┃
┃ The following source file(s) contains confidential, ┃
┃ proprietary information. Unauthorized use is strictly ┃
┃ prohibited. No portions may be copied, reproduced, ┃
┃ or incorporated outside of this domain without ┃
┃ Price Hiller's prior written consent. ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
EOF
cat << EOF | sudo tee /etc/ssh/sshd_config
UsePAM yes
UsePrivilegeSeparation yes
X11Forwarding yes
PermitRootLogin yes
LogLevel VERBOSE
SyslogFacility AUTH
AllowAgentForwarding yes
AllowTcpForwarding yes
PrintMotd no
PubkeyAuthentication yes
PasswordAuthentication no
ChallengeResponseAuthentication no
Banner /etc/ssh/banner
AuthorizedKeysFile .ssh/authorized_keys
Subsystem sftp /usr/libexec/openssh/sftp-server
Compression delayed
EOF
sudo systemctl restart sshd.service