From 1dab0d9e770466c64b6a822d30307848b710c40c Mon Sep 17 00:00:00 2001 From: Super User Date: Mon, 23 Mar 2026 19:16:09 +0800 Subject: embed keys, make scripts idempotent --- core/ssh.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'core/ssh.sh') diff --git a/core/ssh.sh b/core/ssh.sh index c4454ae..f23d571 100755 --- a/core/ssh.sh +++ b/core/ssh.sh @@ -2,11 +2,11 @@ dnf install -y git -echo "PasswordAuthentication no" | sudo tee -a /etc/ssh/sshd_config -echo "AllowTcpForwarding yes" | sudo tee -a /etc/ssh/sshd_config -echo "GatewayPorts yes" | sudo tee -a /etc/ssh/sshd_config -echo "AllowAgentForwarding yes" | sudo tee -a /etc/ssh/sshd_config +grep -q 'PasswordAuthentication no' /etc/ssh/sshd_config || echo "PasswordAuthentication no" | sudo tee -a /etc/ssh/sshd_config +grep -q 'AllowTcpForwarding yes' /etc/ssh/sshd_config || echo "AllowTcpForwarding yes" | sudo tee -a /etc/ssh/sshd_config +grep -q 'GatewayPorts yes' /etc/ssh/sshd_config || echo "GatewayPorts yes" | sudo tee -a /etc/ssh/sshd_config +grep -q 'AllowAgentForwarding yes' /etc/ssh/sshd_config || echo "AllowAgentForwarding yes" | sudo tee -a /etc/ssh/sshd_config -git clone https://git.noml.ch/keys/ ~/keys -~/keys/add-ssh-keys.sh +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +"$SCRIPT_DIR/../keys/add-ssh-keys.sh" sudo systemctl restart sshd -- cgit