--- notion-id: c69e22c6-b9e5-474c-b820-f1c739b22b97 --- ```shell ssh_config 客服端 sshd_config 服务端 ``` 客户端配置: ```shell yum install -y openssh-clients 配置密钥 ssh-keygen 将公钥上传对应需连接客户的.ssh文件中改名authorized_keys 例如/root/.ssh/authorized_keys 或者/home/用户/.ssh/authorized_keys 注意要点: 一、根据你所需要连接的用户@IP进行配置 二、authorized_keys 权限700配置 ``` 服务端配置: /etc/ssh/sshd_config 配置文件修改一下参数 ```shell # 是否允许以root用户身份登录,默认可以 PermitRootLogin yes # 是否允许密码登陆,默认可以 PasswordAuthentication yes # 是否允许公钥验证登陆,默认可以 PubkeyAuthentication yes ```