CentOS 8 配置 ssh

1、安装openssh和openssh-server
dnf -y install openssh
dnf -y install openssh-server

卸载openssh和openssh-server
dnf -y remove openssh
dnf -y remove openssh-server

生成秘钥对,保持默认配置即可。
ssh-keygen

设置ssh,打开登录功能,保持默认配置即可。
编辑/etc/ssh/sshd_config文件:
RSAAuthentication yes
PubkeyAuthentication yes

另外,允许root通过 SSH 登录看,如果禁止root远程登录,那就设置为 no :

PermitRootLogin yes

设置系统开机自启openssh-server,开启openssh-server:

使用MobaXterm连接远程服务器。

posted @ 2020-05-27 15:21  中创IT空间  阅读(4164)  评论(0编辑  收藏  举报