当前位置: 首页> 游戏> 网游 > seo优化实训总结_网页升级维护_search搜索引擎_网络维护公司

seo优化实训总结_网页升级维护_search搜索引擎_网络维护公司

时间:2025/7/15 12:06:39来源:https://blog.csdn.net/qq_50247813/article/details/142979891 浏览次数:0次
seo优化实训总结_网页升级维护_search搜索引擎_网络维护公司

因为在配置过程中需要问题了,所以记录一下。

环境如下:

服务端192.168.0.132 (CentOS Linux release 7.9.2009 (Core))
客户端192.168.0.216(Ubuntu 22.04.5 LTS)

服务端配置密钥对(使用Centos作为服务端实验)
服务端执行:

[root@localhost ~]# ssh-keygen
[root@localhost ~]# ssh-copy-id  bird@192.168.0.216
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
The authenticity of host '192.168.0.216 (192.168.0.216)' can't be established.
ECDSA key fingerprint is SHA256:l2BGywJPJak8cLLAFNb5BX1bdKBoxOrwRWNN32gemqs.
ECDSA key fingerprint is MD5:36:1b:27:32:6d:15:81:a1:46:29:92:15:c0:5b:92:c5.
Are you sure you want to continue connecting (yes/no)? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
bird@192.168.0.216's password: Number of key(s) added: 1Now try logging into the machine, with:   "ssh 'bird@192.168.0.216'"PubkeyAuthentication
and check to make sure that only the key(s) you wanted were added.

客户端SSH配置,禁止密码登录只允许密钥登录:
配置文件路径: /etc/ssh/sshd_config

PasswordAuthentication no
PubkeyAuthentication yes

禁止密码登录,允许密钥登录。最后记得重启 sshd

最后的实验效果使用密码还是可以登录,之后在所有的配置文件中搜索 PubkeyAuthentication 参数,发现存在多个配置文件,如下:

bird@bird:/etc/ssh$ sudo grep -r PasswordAuthentication *
ssh_config:#   PasswordAuthentication yes
sshd_config:PasswordAuthentication no
sshd_config:# PasswordAuthentication.  Depending on your PAM configuration,
sshd_config:# PAM authentication, then enable this but set PasswordAuthentication
sshd_config.d/50-cloud-init.conf:PasswordAuthentication yes

分别是: ssh_config,sshd_config,sshd_config.d/50-cloud-init.conf

将sshd_config.d/50-cloud-init.conf配置文件中PasswordAuthentication yes 修改为 no,重启后密码就被禁止登录了

关键字:seo优化实训总结_网页升级维护_search搜索引擎_网络维护公司

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: