centos安装ssh的方法:首先安装【openssh-server】;然后修改配置文件,并启动ssh的服务;接着设置开机自动启动;最后设置文件夹【~/.ssh】的访问权限即可。

centos安装ssh的方法:
1. 安装openssh-server
yum install -y openssl openssh-server
2. 修改配置文件
用vim打开配置文件/etc/ssh/sshd_config

将上图的PermitRootLogin,RSAAuthentication,PubkeyAuthentication的设置打开。
如知AI笔记
如知笔记——支持markdown的在线笔记,支持ai智能写作、AI搜索,支持DeepseekR1满血大模型
27 查看详情
3、启动ssh的服务:
systemctl start sshd.service
4、设置开机自动启动ssh服务
systemctl enable sshd.service
5、设置文件夹~/.ssh的访问权限:
$ cd ~$ chmod 700 .ssh $ chmod 600 .ssh/* $ ls -la .ssh total 16drwx------. 2 root root 58 May 15 00:23 .dr-xr-x---. 8 root root 4096 May 15 00:26 ..-rw-------. 1 root root 403 May 15 00:22 authorized_keys-rw-------. 1 root root 1766 May 15 00:21 id_rsa-rw-------. 1 root root 403 May 15 00:21 id_rsa.pub
authorized_keys文件存储的是客户端的公共密钥。
相关教程推荐:centos教程
以上就是centos如何安装ssh?的详细内容,更多请关注创想鸟其它相关文章!
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 chuangxiangniao@163.com 举报,一经查实,本站将立刻删除。
发布者:程序猿,转转请注明出处:https://www.chuangxiangniao.com/p/380939.html
微信扫一扫
支付宝扫一扫