在Fedora中设置SSH服务和密钥认证可以通过以下步骤完成:
sudo dnf install openssh-server
sudo systemctl start sshd
sudo systemctl enable sshd
PermitRootLogin no # 禁止root用户登录
PasswordAuthentication no # 禁止使用密码登录
sudo systemctl restart sshd
ssh-keygen -t rsa
cat id_rsa.pub >> ~/.ssh/authorized_keys
现在你已经设置了SSH服务和密钥认证,可以使用密钥对进行SSH连接了。