just push

This commit is contained in:
dichgrem 2025-02-13 14:47:07 +08:00
parent 2dc0946075
commit bdd70817d4
15 changed files with 7 additions and 6 deletions

View File

@ -393,12 +393,13 @@ ip -6 addr show scope global
- 随后将.pub后缀的公钥中的内容写入服务器的``~/.ssh/authorized_keys``中;
- 使用命令``vim /etc/ssh/sshd_config``编译服务器的SSH配置将其中的该行改为``PasswordAuthentication no``,保存退出;随后使用``sudo systemctl restart sshd``重启SSH即可禁用密码登录
- 使用命令``vim /etc/ssh/sshd_config``编译服务器的SSH配置将其中的该行改为``PasswordAuthentication no``,保存退出;随后使用``sudo systemctl restart sshd``重启SSH即可禁用密码登录将**PermitRootLogin prohibit-password**改为prohibit-password即可实现仅root用户密钥登录
- 使用``sudo cat /etc/ssh/sshd_config | grep -E 'PasswordAuthentication|PubkeyAuthentication'
`` 命令查看输出,如有**PasswordAuthentication no → 禁用密码登录**以及**PubkeyAuthentication yes → 允许密钥登录**则成功。 ``
- 使用**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。

View File

@ -334,10 +334,10 @@
<p>随后将.pub后缀的公钥中的内容写入服务器的<code>~/.ssh/authorized_keys</code>中;</p>
</li>
<li>
<p>使用命令<code>vim /etc/ssh/sshd_config</code>编译服务器的SSH配置将其中的该行改为<code>PasswordAuthentication no</code>,保存退出;随后使用<code>sudo systemctl restart sshd</code>重启SSH即可禁用密码登录</p>
<p>使用命令<code>vim /etc/ssh/sshd_config</code>编译服务器的SSH配置将其中的该行改为<code>PasswordAuthentication no</code>,保存退出;随后使用<code>sudo systemctl restart sshd</code>重启SSH即可禁用密码登录<strong>PermitRootLogin prohibit-password</strong>改为prohibit-password即可实现仅root用户密钥登录</p>
</li>
<li>
<p>使用<code>sudo cat /etc/ssh/sshd_config | grep -E 'PasswordAuthentication|PubkeyAuthentication' </code> 命令查看输出,如有<strong>PasswordAuthentication no → 禁用密码登录</strong>以及<strong>PubkeyAuthentication yes → 允许密钥登录</strong>则成功。 ``</p>
<p>使用<strong>sudo cat /etc/ssh/sshd_config | grep -E 'PasswordAuthentication|PubkeyAuthentication'<strong>命令查看输出,如有</strong>PasswordAuthentication no → 禁用密码登录</strong>以及<strong>PubkeyAuthentication yes → 允许密钥登录</strong>则成功。</p>
</li>
<li>
<p>注意<strong>authorized_keys</strong>的权限为600如果不是则需要改正<code>chmod 600 ~/.ssh/authorized_keys</code></p>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1 +1 @@
{"version":"1.3.0","languages":{"en":{"hash":"en_9e6273b20d","wasm":"en","page_count":105}}}
{"version":"1.3.0","languages":{"en":{"hash":"en_1267fe75e5","wasm":"en","page_count":105}}}

Binary file not shown.