Bash_Scripts/SSH/SSH-Configuration.bash

39 lines
1.4 KiB
Bash
Raw Normal View History

2021-07-28 09:32:08 -05:00
#!/bin/bash --posix
sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.back
2021-07-28 17:59:47 -05:00
cat << 'EOF' | sudo tee "/etc/ssh/banner"
2021-07-28 09:32:08 -05:00
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
2021-09-28 02:34:51 -05:00
┃ Orion Technologies - Security Notice ┃
2021-07-28 09:32:08 -05:00
┃ ------------------------------------ ┃
┃ 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 ┃
2021-09-28 02:34:51 -05:00
┃ Price Hiller's prior written consent. ┃
2021-07-28 09:32:08 -05:00
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
EOF
cat << EOF | sudo tee /etc/ssh/sshd_config
UsePAM yes
2021-09-28 02:34:51 -05:00
UsePrivilegeSeparation yes
2021-07-28 09:32:08 -05:00
X11Forwarding yes
PermitRootLogin yes
2021-09-28 02:34:51 -05:00
LogLevel VERBOSE
2021-07-28 09:32:08 -05:00
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
2021-09-28 02:34:51 -05:00
Compression delayed
2021-07-28 09:32:08 -05:00
EOF
2021-07-28 17:59:47 -05:00
sudo systemctl restart sshd.service