1. 安装openssh-serveAxekLHhOr yum install -y openssl openssh-server 2. 修改配置文件 用vim打开配置文件/etc/ssh/sshd_config
yum install -y openssl openssh-server
用vim
打开配置文件/etc/ssh/sshd_config
将上图的PermitRootLogin
,RSAAuthentication
,PubkeyAuthentication
的设置打开。
启动ssh的服务:
systemctl start sshd.service
设置开机自动启动ssh服务
systemctl enable sshd.service
设置文件夹~/.ssh的访问权限:
$ cd ~
$ chmod 700 .ssh AxekLHhO
$ chmod 600 .ssh/*
$ ls -la .ssh
total 16
drwx------. 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-------.AxekLHhO 1 root root 403 May 15 00:21 id_rsa.pub
authorized_keys
文件存储的是客户端的公共密钥
。
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持我们。
--结束END--
本文标题: 在CentOS7中安装和配置ssh
本文链接: https://www.lsjlt.com/news/21528.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-03-01
2024-03-01
2024-03-01
2024-03-01
2024-03-01
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0