This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # GuDuu 伺服器接入引導:裝部署公鑰 + 確保 sshd 允許金鑰登入 + 診斷握手被掐的原因 + 重啟 sshd | |
| set +e | |
| echo "===== [1] 裝入部署公鑰 =====" | |
| mkdir -p /root/.ssh | |
| cat > /root/.ssh/authorized_keys <<'KEY' | |
| ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIF8dJN2lnY/kvCU04VN+JKDeSyEUiPx3nvVesnGHi1oJ guduu@guduu.co | |
| KEY | |
| chmod 700 /root/.ssh && chmod 600 /root/.ssh/authorized_keys | |
| echo "已寫入 /root/.ssh/authorized_keys" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIF8dJN2lnY/kvCU04VN+JKDeSyEUiPx3nvVesnGHi1oJ guduu@guduu.co |