Note: Using Alibaba Cloud lightweight application server, this article introduces how to configure the remote server in Jenkins. For Jenkins installation, refer to this article ;
Step 1: Start the service
First, start the Jenkins container, enter the Jenkins management background, and click 系统配置
;
Step 2: Configure SSH Server
After entering the system settings, scroll to the bottom, find Publish over SSH
the configuration, and fill in the SSH Server information: set a service name, IP address, and user name;
Step 3: Fill in the password and secret key
Check the box below Use password authentication, or user a different key
and fill in the cloud server password and server secret key;
Step 4: Get the secret key
I have read many articles saying that this secret key is set in the server. Actually no, this secret key is obtained from the console of the cloud service. For example, mine is Alibaba Cloud, find the server 控制台->远程链接->秘钥管理
, and find your own key fingerprint;
This is downloaded at the beginning of the setup. If you forgot to download it or don’t know where to put it after downloading it, you can delete it and reset it. After downloading, it will be a .pem file;
Open it with an editor and the content is as follows:
Copy this to jenkins;
Step 5: Test
After the setting is completed, click below Test configuration
and test to see if it can pass. If it appears, it Success
means success;