summaryrefslogtreecommitdiff
path: root/core/ssh.sh
diff options
context:
space:
mode:
Diffstat (limited to 'core/ssh.sh')
-rwxr-xr-xcore/ssh.sh14
1 files changed, 9 insertions, 5 deletions
diff --git a/core/ssh.sh b/core/ssh.sh
index f23d571..63d5ea9 100755
--- a/core/ssh.sh
+++ b/core/ssh.sh
@@ -1,11 +1,15 @@
1#!/bin/bash 1#!/bin/bash
2 2
3dnf install -y git 3sudo dnf install -y git
4 4
5grep -q 'PasswordAuthentication no' /etc/ssh/sshd_config || echo "PasswordAuthentication no" | sudo tee -a /etc/ssh/sshd_config 5sudo sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication no/' /etc/ssh/sshd_config
6grep -q 'AllowTcpForwarding yes' /etc/ssh/sshd_config || echo "AllowTcpForwarding yes" | sudo tee -a /etc/ssh/sshd_config 6grep -q '^PasswordAuthentication' /etc/ssh/sshd_config || echo "PasswordAuthentication no" | sudo tee -a /etc/ssh/sshd_config
7grep -q 'GatewayPorts yes' /etc/ssh/sshd_config || echo "GatewayPorts yes" | sudo tee -a /etc/ssh/sshd_config 7sudo sed -i 's/^#\?AllowTcpForwarding.*/AllowTcpForwarding yes/' /etc/ssh/sshd_config
8grep -q 'AllowAgentForwarding yes' /etc/ssh/sshd_config || echo "AllowAgentForwarding yes" | sudo tee -a /etc/ssh/sshd_config 8grep -q '^AllowTcpForwarding' /etc/ssh/sshd_config || echo "AllowTcpForwarding yes" | sudo tee -a /etc/ssh/sshd_config
9sudo sed -i 's/^#\?GatewayPorts.*/GatewayPorts yes/' /etc/ssh/sshd_config
10grep -q '^GatewayPorts' /etc/ssh/sshd_config || echo "GatewayPorts yes" | sudo tee -a /etc/ssh/sshd_config
11sudo sed -i 's/^#\?AllowAgentForwarding.*/AllowAgentForwarding yes/' /etc/ssh/sshd_config
12grep -q '^AllowAgentForwarding' /etc/ssh/sshd_config || echo "AllowAgentForwarding yes" | sudo tee -a /etc/ssh/sshd_config
9 13
10SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 14SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
11"$SCRIPT_DIR/../keys/add-ssh-keys.sh" 15"$SCRIPT_DIR/../keys/add-ssh-keys.sh"