Bo's Log 一寸欢喜

How to setup key pair for Linux

2018-04-24
Bo Chen

Generate SSH key

ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/

Create a user in target env and authenticate by public key

  • useradd username
  • cd etc/ssh
  • cp sshd_configure sshd_configure.backup
  • enable the public key authentication
  • service sshd restart
  • service sshd status
  • vim ~/.ssh/authorized_keys
  • append the public key to the keys file
  • usermod -a -G groupname username

Save the private key to Jenkins and called by pipeline


Similar Posts

下一篇 塔吉锅菜谱

Content