要运行 sshd 需要 一个配置文件 和 主机 keys。配置文件 可以在 /etc/ssh 找到。
sshd_config:
# 后面代表默认值。
PermitRootLogin:允许root 远程登录
创建 host keys
host keys 对,公钥 有 .pub,私钥没有后缀。
RSA DSA :
openssh 的 ssh-keygen 创建 keys:
ssh_known_host 用来存放 其他主机的 公钥。
启动 ssh 服务器
安装它的包 可以 创建 keys,启动服务,把服务添加到 bootup configuration 里。
boot 的时候,启动sshd
# systemctl enable sshd
立刻启动 sshd
# systemctl start sshd
有两种启动模式:standalone 和 on-demand。可以用root 去启动;systemd 也可以 通过 socket unit 来启动 sshd。