From 94b365889bb161fb9dc553ca9a9ce6744aa5a504 Mon Sep 17 00:00:00 2001 From: Cat Tom Date: Thu, 12 Mar 2026 21:04:06 +0800 Subject: [PATCH] edit commands.md --- ...ds-for-Server-Operation-and-Maintenance.md | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/docs/tech/Commands-for-Server-Operation-and-Maintenance.md b/docs/tech/Commands-for-Server-Operation-and-Maintenance.md index 81eef96..fef1c86 100644 --- a/docs/tech/Commands-for-Server-Operation-and-Maintenance.md +++ b/docs/tech/Commands-for-Server-Operation-and-Maintenance.md @@ -8,7 +8,7 @@ level: classified ### Maria -**推送 GitHub 私钥**: +**配置 GitHub 私钥**: ```bash # 在 CatTomServer1 处执行 @@ -19,10 +19,27 @@ rsync -avP /home/cattom/.ssh/cattomgithub root@[server_ip]:/root/.ssh/ rsync -avP -e 'ssh -p 25800 -i /home/cattom/.ssh/Maria' /home/cattom/.ssh/cattomgithub root@[server_ip]:/root/.ssh/ ``` +**编辑 SSH 客户端配置**: + +```bash +sudo nano ~/.ssh/config +``` + +``` title="~/.ssh/config" +Host github.com +HostName ssh.github.com +User git +Port 443 +PreferredAuthentications publickey +IdentityFile "~/.ssh/cattomgithub" +``` + +测试能否正常连接: `ssh -T git@github.com` + **克隆 Maria 仓库**: ```bash -git config --global credential.helper store && git clone https://github.com/cattomgithub/maria.git +git clone git@github.com:cattomgithub/maria.git cd maria/script && chmod +x *.sh && ./maria.sh ```