From 3fc77a32ad9e95b2b683d1bc5d813126cdb581b1 Mon Sep 17 00:00:00 2001 From: LamGC Date: Mon, 23 Oct 2023 08:21:58 +0000 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20authorized=5Fke?= =?UTF-8?q?ys=20=E4=BF=9D=E5=AD=98=E5=90=8E=E4=B8=A2=E5=A4=B1=E6=8D=A2?= =?UTF-8?q?=E8=A1=8C=E7=AC=A6=E7=9A=84=E9=97=AE=E9=A2=98.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- conf-sshd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 conf-sshd.sh diff --git a/conf-sshd.sh b/conf-sshd.sh old mode 100644 new mode 100755 index a10c0d1..9935835 --- a/conf-sshd.sh +++ b/conf-sshd.sh @@ -79,7 +79,7 @@ update_sshkeys() { echo "-------------------- SSH Keys --------------------" echo "$ssh_keys" echo "--------------------------------------------------" - echo $ssh_keys > ~/.ssh/authorized_keys + echo "$ssh_keys" > ~/.ssh/authorized_keys chmod 600 ~/.ssh/authorized_keys # 输出更新成功,需要附带时间日期 echo "SSH public key updated successfully at $(date '+%Y-%m-%d %H:%M:%S')" From 44a6cbbdbe47914b30c4bdff230807ac613bafb7 Mon Sep 17 00:00:00 2001 From: LamGC Date: Mon, 23 Oct 2023 08:50:10 +0000 Subject: [PATCH 2/2] =?UTF-8?q?docs:=20=E8=A1=A5=E5=85=85=E6=9C=89?= =?UTF-8?q?=E5=85=B3=E5=8D=95=E7=8B=AC=E6=8C=89=E7=85=A7=20SSH=20=E5=AF=86?= =?UTF-8?q?=E9=92=A5=E7=9A=84=E4=BD=BF=E7=94=A8=E8=AF=B4=E6=98=8E.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 98fbfee..dc9a33b 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ - 定期自动更新 SSH 公钥到服务器中; - 集中管理注册到服务器的 SSH 公钥(例如使用 Github 管理 SSH 公钥); -## Usage +## Quick Usage 部署密钥并设置定期更新: ```bash curl -s https://ssh.lamgc.me | bash -s -- -c @@ -15,6 +15,10 @@ curl -s https://ssh.lamgc.me | bash -s -- -c ```bash curl -s https://ssh.lamgc.me | bash -s ``` +跳过检查 SSH Server,只需要安装秘钥的话,就需要单独使用 `-o` 参数: +```bash +curl -s https://ssh.lamgc.me | bash -s -- -o +``` 添加 `-p yes` 参数可以设置允许 Root 用户使用密码登录 SSH(需使用 Root 用户执行脚本): ```bash curl -s https://ssh.lamgc.me | bash -s -- -p yes @@ -24,6 +28,8 @@ curl -s https://ssh.lamgc.me | bash -s -- -p yes curl -s https://ssh.lamgc.me | bash -s -- -h ``` +> Note: 更多用法请参见脚本帮助信息~ + ## Paths 获取 SSH 公钥: ```