CentOS 8 配置 ssh

1.安装openssh和openssh-server

  dnf -y install openssh
  dnf -y install openssh-server

2.卸载openssh和openssh-server

  dnf -y remove openssh
  dnf -y remove openssh-server

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

  PermitRootLogin yes

4.启动sshd服务

  service sshd start
  ps -ef | grep sshd

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

  systemctl enable sshd
  systemctl start sshd
  systemctl status sshd
  systemctl list-unit-files | grep sshd

6.查询centos服务ip使用登录密码测试远程链接

 ssh -p 端口 用户@centos服务ip
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。