1 首先对下载的 key文件设置权限
chmod 400 ssh-key-2022-02-25.key
2 其次:使用ssh进行连接
lwf@macdeMacBook-Air ~ % ssh -i ./ssh-key-2022-02-25.key opc@14.24.2.1
3 最后登录以后去掉一定要密钥登录
首先设置root 密码:sudo passwd
然后进入/etc/ssh/ 修改sshd_config文件
这里 取消 AuthorizedKeysFile .ssh/authorized_keys
PasswordAuthentication no 改为yes
PermitEmptyPasswords no 禁止空密码登录
PermitRootLogin no