[email protected]' 1. Upload public key to server scp ~/.ssh/id rs...">

当前位置:网站首页>ECS settings SSH key login

ECS settings SSH key login

2022-07-04 22:57:00 Song Xiaoyu

  1. The client generates public and private keys ssh-keygen -t rsa -b 4096 -C "[email protected]"
  2. Upload public key to server scp ~/.ssh/id_rsa.pub [email protected] Server address :/root
  3. Log in to the server
  4. establish .ssh file mkdir /root/.ssh
  5. create a file cd /root/.ssh touch authorized_keys
  6. Add the private key cat id_rsa.pub >> /root/.ssh/authorized_keys
  7. Add permissions chmod -R 700 .ssh
# ssh The configuration file is located in 
vim /etc/ssh/sshd_config
 
#  restart ssh
systemctl restart sshd.service

Reference documents

https://developer.aliyun.com/article/641091

Pay attention to chown Is to change the owner ,chmod Is to change permissions

原网站

版权声明
本文为[Song Xiaoyu]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/185/202207042230009681.html