1
0
Fork 0

SSH secure

This commit is contained in:
VirtuBox 2019-08-06 17:26:56 +02:00
parent 4485677faa
commit 730424f5aa
Signed by: virtubox
GPG Key ID: 22EB296C97BAD476
1 changed files with 2 additions and 1 deletions

View File

@ -502,11 +502,12 @@ _UFW_MINIMAL() {
}
_SSH_SECURE() {
CURRENT_SSH_PORT=$(grep "Port" /etc/ssh/sshd_config | awk -F " " '{print $2}')
wget https://raw.githubusercontent.com/VirtuBox/ubuntu-nginx-web-server/master/etc/ssh/sshd_config -O /etc/ssh/sshd_config
if [ -n "$1" ]; then
sed -i "s/Port 22/Port $1/" /etc/ssh/sshd_config
else
sed -i "s/Port 22/Port 10022/" /etc/ssh/sshd_config
sed -i "s/Port 22/Port $CURRENT_SSH_PORT/" /etc/ssh/sshd_config
fi
}