zl程序教程

您现在的位置是:首页 >  后端

当前栏目

ssh 免密码登录

2023-09-14 09:09:49 时间

系列文章目录

Linux



前言

ssh


一、本机SSH公钥上传到Linux服务器

ssh-copy-id -p 22 root@192.168.1.2
  • 配置host
# cat /etc/hosts
192.168.2.3 ubuntu-03
  • 使用hostname登录
root@ubuntu-01:~# ssh ubuntu-03

二、增加安全性禁止使用密码登录SSH

  • Ubuntu
  • cat /etc/ssh/sshd_config
#PasswordAuthentication yes
PasswordAuthentication no
/etc/init.d/ssh restart

三、参考