diff --git a/content/about-server-set.md b/content/about-server-set.md
index 0609257..552cf2f 100644
--- a/content/about-server-set.md
+++ b/content/about-server-set.md
@@ -208,7 +208,15 @@ sudo adduser dich
sudo usermod -aG sudo dich
````
-确认一下sudo权限已经生效。可以尝试使用新用户执行一个需要sudo权限的命令,如:
+确认一下sudo权限已经生效。
+
+PS:删除用户及其主目录
+```
+sudo userdel -r 用户名
+```
+此命令不仅删除用户,还会删除用户的主目录及邮件存储目录(如果有)。
+
+可以尝试使用新用户执行一个需要sudo权限的命令,如:
````
sudo ls /root
@@ -377,4 +385,20 @@ sysctl --system # reload sysctl
ip -6 addr show scope global
或者 curl ipv6.ip.sb
-```
\ No newline at end of file
+```
+
+## 改为密钥登录
+
+- 在本地执行 ``ssh-keygen``,随后生成.pub后缀的公钥和无后缀的密钥,注意不同密钥对名称不能相同;同时可以为这两个文件用密码加密;
+
+- 随后将.pub后缀的公钥中的内容写入服务器的``~/.ssh/authorized_keys``中;
+
+- 使用命令``vim /etc/ssh/sshd_config``编译服务器的SSH配置,将其中的该行改为``PasswordAuthentication no``,保存退出;随后使用``sudo systemctl restart sshd``重启SSH即可禁用密码登录;
+
+- 使用``sudo cat /etc/ssh/sshd_config | grep -E 'PasswordAuthentication|PubkeyAuthentication'
+`` 命令查看输出,如有**PasswordAuthentication no → 禁用密码登录**以及**PubkeyAuthentication yes → 允许密钥登录**则成功。 ``
+
+- 注意**authorized_keys**的权限为600,如果不是则需要改正:``chmod 600 ~/.ssh/authorized_keys``
+
+- 随后可以在本地尝试登录,命令为``ssh -i ~/.ssh/id_xxx -p 端口 用户名@服务器IP``,第一次登录会提示服务器公钥的哈希值,需要选Yes。
+
diff --git a/public/about-server-set/index.html b/public/about-server-set/index.html
index 1c3b664..789de47 100644
--- a/public/about-server-set/index.html
+++ b/public/about-server-set/index.html
@@ -223,7 +223,12 @@
接下来,将新用户添加到sudo组,以赋予sudo权限。执行以下命令:
sudo usermod -aG sudo dich
-确认一下sudo权限已经生效。可以尝试使用新用户执行一个需要sudo权限的命令,如:
+确认一下sudo权限已经生效。
+PS:删除用户及其主目录
+sudo userdel -r 用户名
+
+此命令不仅删除用户,还会删除用户的主目录及邮件存储目录(如果有)。
+可以尝试使用新用户执行一个需要sudo权限的命令,如:
sudo ls /root
系统会要求输入密码,如果成功执行,说明新用户已经成功获得sudo权限。
@@ -320,6 +325,27 @@
或者 curl ipv6.ip.sb
+改为密钥登录
+
+-
+
在本地执行 ssh-keygen
,随后生成.pub后缀的公钥和无后缀的密钥,注意不同密钥对名称不能相同;同时可以为这两个文件用密码加密;
+
+-
+
随后将.pub后缀的公钥中的内容写入服务器的~/.ssh/authorized_keys
中;
+
+-
+
使用命令vim /etc/ssh/sshd_config
编译服务器的SSH配置,将其中的该行改为PasswordAuthentication no
,保存退出;随后使用sudo systemctl restart sshd
重启SSH即可禁用密码登录;
+
+-
+
使用sudo cat /etc/ssh/sshd_config | grep -E 'PasswordAuthentication|PubkeyAuthentication'
命令查看输出,如有PasswordAuthentication no → 禁用密码登录以及PubkeyAuthentication yes → 允许密钥登录则成功。 ``
+
+-
+
注意authorized_keys的权限为600,如果不是则需要改正:chmod 600 ~/.ssh/authorized_keys
+
+-
+
随后可以在本地尝试登录,命令为ssh -i ~/.ssh/id_xxx -p 端口 用户名@服务器IP
,第一次登录会提示服务器公钥的哈希值,需要选Yes。
+
+
diff --git a/public/pagefind/fragment/en_49a1449.pf_fragment b/public/pagefind/fragment/en_49a1449.pf_fragment
deleted file mode 100644
index 614d0cb..0000000
Binary files a/public/pagefind/fragment/en_49a1449.pf_fragment and /dev/null differ
diff --git a/public/pagefind/fragment/en_e9f677a.pf_fragment b/public/pagefind/fragment/en_e9f677a.pf_fragment
new file mode 100644
index 0000000..ab681ef
Binary files /dev/null and b/public/pagefind/fragment/en_e9f677a.pf_fragment differ
diff --git a/public/pagefind/index/en_2a832a5.pf_index b/public/pagefind/index/en_2a832a5.pf_index
deleted file mode 100644
index 3b71644..0000000
Binary files a/public/pagefind/index/en_2a832a5.pf_index and /dev/null differ
diff --git a/public/pagefind/index/en_4518d48.pf_index b/public/pagefind/index/en_4518d48.pf_index
deleted file mode 100644
index d3de31c..0000000
Binary files a/public/pagefind/index/en_4518d48.pf_index and /dev/null differ
diff --git a/public/pagefind/index/en_4ba2de4.pf_index b/public/pagefind/index/en_4ba2de4.pf_index
deleted file mode 100644
index 5f1d0bc..0000000
Binary files a/public/pagefind/index/en_4ba2de4.pf_index and /dev/null differ
diff --git a/public/pagefind/index/en_53b4a8c.pf_index b/public/pagefind/index/en_53b4a8c.pf_index
new file mode 100644
index 0000000..dfbecdb
Binary files /dev/null and b/public/pagefind/index/en_53b4a8c.pf_index differ
diff --git a/public/pagefind/index/en_69cebb1.pf_index b/public/pagefind/index/en_69cebb1.pf_index
deleted file mode 100644
index b5a2d13..0000000
Binary files a/public/pagefind/index/en_69cebb1.pf_index and /dev/null differ
diff --git a/public/pagefind/index/en_89f4e9f.pf_index b/public/pagefind/index/en_89f4e9f.pf_index
new file mode 100644
index 0000000..0864d95
Binary files /dev/null and b/public/pagefind/index/en_89f4e9f.pf_index differ
diff --git a/public/pagefind/index/en_c27e61c.pf_index b/public/pagefind/index/en_c27e61c.pf_index
new file mode 100644
index 0000000..ac3ca05
Binary files /dev/null and b/public/pagefind/index/en_c27e61c.pf_index differ
diff --git a/public/pagefind/index/en_c748e24.pf_index b/public/pagefind/index/en_c748e24.pf_index
new file mode 100644
index 0000000..a72e470
Binary files /dev/null and b/public/pagefind/index/en_c748e24.pf_index differ
diff --git a/public/pagefind/pagefind-entry.json b/public/pagefind/pagefind-entry.json
index ae7c32d..8141125 100644
--- a/public/pagefind/pagefind-entry.json
+++ b/public/pagefind/pagefind-entry.json
@@ -1 +1 @@
-{"version":"1.3.0","languages":{"en":{"hash":"en_e237b1ed84","wasm":"en","page_count":105}}}
\ No newline at end of file
+{"version":"1.3.0","languages":{"en":{"hash":"en_9e6273b20d","wasm":"en","page_count":105}}}
\ No newline at end of file
diff --git a/public/pagefind/pagefind.en_9e6273b20d.pf_meta b/public/pagefind/pagefind.en_9e6273b20d.pf_meta
new file mode 100644
index 0000000..550499c
Binary files /dev/null and b/public/pagefind/pagefind.en_9e6273b20d.pf_meta differ
diff --git a/public/pagefind/pagefind.en_e237b1ed84.pf_meta b/public/pagefind/pagefind.en_e237b1ed84.pf_meta
deleted file mode 100644
index b8a4510..0000000
Binary files a/public/pagefind/pagefind.en_e237b1ed84.pf_meta and /dev/null differ