diff options
| author | Super User <root@p.noml.ch> | 2026-03-23 19:18:34 +0800 |
|---|---|---|
| committer | Super User <root@p.noml.ch> | 2026-03-23 19:18:34 +0800 |
| commit | 6086e908152e97011681e6d91cd7fe627c5cf02f (patch) | |
| tree | c0a4b86266dda798f02ab3b04cffd52e7b7da9dc /core/ssh.sh | |
| parent | 1dab0d9e770466c64b6a822d30307848b710c40c (diff) | |
fix ssh sed-replace, remove set paste, add claude idempotency guard
Diffstat (limited to 'core/ssh.sh')
| -rwxr-xr-x | core/ssh.sh | 14 |
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 | ||
| 3 | dnf install -y git | 3 | sudo dnf install -y git |
| 4 | 4 | ||
| 5 | grep -q 'PasswordAuthentication no' /etc/ssh/sshd_config || echo "PasswordAuthentication no" | sudo tee -a /etc/ssh/sshd_config | 5 | sudo sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication no/' /etc/ssh/sshd_config |
| 6 | grep -q 'AllowTcpForwarding yes' /etc/ssh/sshd_config || echo "AllowTcpForwarding yes" | sudo tee -a /etc/ssh/sshd_config | 6 | grep -q '^PasswordAuthentication' /etc/ssh/sshd_config || echo "PasswordAuthentication no" | sudo tee -a /etc/ssh/sshd_config |
| 7 | grep -q 'GatewayPorts yes' /etc/ssh/sshd_config || echo "GatewayPorts yes" | sudo tee -a /etc/ssh/sshd_config | 7 | sudo sed -i 's/^#\?AllowTcpForwarding.*/AllowTcpForwarding yes/' /etc/ssh/sshd_config |
| 8 | grep -q 'AllowAgentForwarding yes' /etc/ssh/sshd_config || echo "AllowAgentForwarding yes" | sudo tee -a /etc/ssh/sshd_config | 8 | grep -q '^AllowTcpForwarding' /etc/ssh/sshd_config || echo "AllowTcpForwarding yes" | sudo tee -a /etc/ssh/sshd_config |
| 9 | sudo sed -i 's/^#\?GatewayPorts.*/GatewayPorts yes/' /etc/ssh/sshd_config | ||
| 10 | grep -q '^GatewayPorts' /etc/ssh/sshd_config || echo "GatewayPorts yes" | sudo tee -a /etc/ssh/sshd_config | ||
| 11 | sudo sed -i 's/^#\?AllowAgentForwarding.*/AllowAgentForwarding yes/' /etc/ssh/sshd_config | ||
| 12 | grep -q '^AllowAgentForwarding' /etc/ssh/sshd_config || echo "AllowAgentForwarding yes" | sudo tee -a /etc/ssh/sshd_config | ||
| 9 | 13 | ||
| 10 | SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | 14 | SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" |
| 11 | "$SCRIPT_DIR/../keys/add-ssh-keys.sh" | 15 | "$SCRIPT_DIR/../keys/add-ssh-keys.sh" |
