Noonisy
SSH 相关
2024-10-25
阅读:270

SSH 相关


SSH 密钥

命令:
ssh-keygen -t ed25519
默认保存路径:~/.ssh/id_rsa

在远程服务器上,复制公钥.pub 里面的内容,粘贴到 ~/.ssh/authorized_keys 文件
如果服务器没有 authorized_keys 文件可先创建
chmod 600 ~/.ssh/authorized_keys
chmod 700 ~/.ssh
SSH 服务配置
PermitRootLogin prohibit-password   # 禁止root用户通过密码登录
PasswordAuthentication no          # 禁用密码登录
PubkeyAuthentication yes           # 启用公钥认证
AuthorizedKeysFile .ssh/authorized_keys  # 公钥存储位置
重启 ubuntu SSH 服务以应用配置:
sudo systemctl restart ssh
最后编辑于:2025 年 01 月 05 日 22:45
邮箱格式错误
网址请用http://或https://开头