Bash_Scripts/SSH/SSH-Configuration.bash

45 lines
1.6 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
cat << EOF | sudo tee "/etc/ssh/banner"
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Cloud Technology - 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 ┃
┃ Cloud Hybrid LLCs or Price Hiller's ┃
┃ prior written consent. ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
EOF
cat << EOF | sudo tee /etc/ssh/sshd_config
UsePAM yes
X11Forwarding yes
PermitRootLogin yes
LogLevel INFO
SyslogFacility AUTH
AllowAgentForwarding yes
AllowTcpForwarding yes
PrintMotd no
PubkeyAuthentication yes
PasswordAuthentication no
ChallengeResponseAuthentication no
AcceptEnv LANG LC_*
Banner /etc/ssh/banner
AuthorizedKeysFile .ssh/authorized_keys
AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
AcceptEnv LC_IDENTIFICATION LC_ALL LANGUAGE
AcceptEnv XMODIFIERS
Subsystem sftp /usr/libexec/openssh/sftp-server
EOF
sudo systemctl restart sshd.service