在 centos8 stream 中启动sshd

创建日期: 2022-11-22 14:32 | 作者: 风波 | 浏览次数: 11 | 分类: Docker

使用 centos8:stream 镜像中启动 sshd 服务。

  1. 安装 openssh-server
yum install -y openssh-server
  1. 生成系统公钥
ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key
ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key
ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key
ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key
  1. 启动 sshd
/usr/sbin/sshd -D

参考:https://www.xmodulo.com/sshd-error-could-not-load-host-key.html

11 浏览
0 评论