1. 程式人生 > >centos7配置免密登陸

centos7配置免密登陸

1.生成公鑰
ssh-keygen -t rsa   //一直回車執行即可

2.新增公鑰

cd .ssh
cat id_rsa.pub > authorized_keys  //如果沒有建立即可

3.賦予許可權

chmod 600 ~/.ssh/authorized_key   //沒有許可權無法免密登入成功

4.測試免密登陸

ssh localhost