mirror of
				https://github.com/appleboy/drone-ssh.git
				synced 2025-10-29 00:51:15 +08:00 
			
		
		
		
	update readme.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
		
							parent
							
								
									d55423fa68
								
							
						
					
					
						commit
						167eff1be0
					
				
							
								
								
									
										7
									
								
								DOCS.md
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								DOCS.md
									
									
									
									
									
								
							| @ -8,6 +8,7 @@ The following parameters are used to configure the plugin: | |||||||
| * **host** - address or IP of the remote machine | * **host** - address or IP of the remote machine | ||||||
| * **port** - port to connect to on the remote machine | * **port** - port to connect to on the remote machine | ||||||
| * **user** - user to log in as on the remote machine | * **user** - user to log in as on the remote machine | ||||||
|  | * **passsword** - password to log in as on the remote machine | ||||||
| * **key** - private SSH key for the remote machine | * **key** - private SSH key for the remote machine | ||||||
| * **sleep** - sleep for seconds between host connections | * **sleep** - sleep for seconds between host connections | ||||||
| * **timeout** - timeout for the tcp connection attempt | * **timeout** - timeout for the tcp connection attempt | ||||||
| @ -18,16 +19,19 @@ The following secret values can be set to configure the plugin. | |||||||
| * **SSH_HOST** - corresponds to **host** | * **SSH_HOST** - corresponds to **host** | ||||||
| * **SSH_PORT** - corresponds to **port** | * **SSH_PORT** - corresponds to **port** | ||||||
| * **SSH_USER** - corresponds to **user** | * **SSH_USER** - corresponds to **user** | ||||||
|  | * **SSH_PASSWORD** - corresponds to **password** | ||||||
| * **SSH_KEY** - corresponds to **key** | * **SSH_KEY** - corresponds to **key** | ||||||
| * **SSH_SLEEP** - corresponds to **sleep** | * **SSH_SLEEP** - corresponds to **sleep** | ||||||
| * **SSH_TIMEOUT** - corresponds to **timeout** | * **SSH_TIMEOUT** - corresponds to **timeout** | ||||||
| 
 | 
 | ||||||
| It is highly recommended to put the **SSH_KEY** into a secret so it is not | It is highly recommended to put the **SSH_KEY** and **SSH_PASSWORD** into a secret so it is not | ||||||
| exposed to users. This can be done using the drone-cli. | exposed to users. This can be done using the drone-cli. | ||||||
| 
 | 
 | ||||||
| ```bash | ```bash | ||||||
| drone secret add --image=plugins/ssh \ | drone secret add --image=plugins/ssh \ | ||||||
|     octocat/hello-world SSH_KEY @path/to/.ssh/id_rsa |     octocat/hello-world SSH_KEY @path/to/.ssh/id_rsa | ||||||
|  | drone secret add --image=plugins/ssh \ | ||||||
|  |     octocat/hello-world SSH_PASSWORD admin1234 | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
| Then sign the YAML file after all secrets are added. | Then sign the YAML file after all secrets are added. | ||||||
| @ -49,6 +53,7 @@ pipeline: | |||||||
|     image: plugins/ssh |     image: plugins/ssh | ||||||
|     host: foo.com |     host: foo.com | ||||||
|     user: root |     user: root | ||||||
|  |     password: 1234 | ||||||
|     port: 22 |     port: 22 | ||||||
|     script: |     script: | ||||||
|       - echo hello |       - echo hello | ||||||
|  | |||||||
| @ -44,8 +44,9 @@ docker run --rm \ | |||||||
|   -e PLUGIN_HOST=foo.com \ |   -e PLUGIN_HOST=foo.com \ | ||||||
|   -e PLUGIN_USER=root \ |   -e PLUGIN_USER=root \ | ||||||
|   -e PLUGIN_KEY="$(cat ${HOME}/.ssh/id_rsa)" \ |   -e PLUGIN_KEY="$(cat ${HOME}/.ssh/id_rsa)" \ | ||||||
|  |   -e PLUGIN_PASSWORD=xxxxx \ | ||||||
|   -e PLUGIN_SCRIPT=whoami \ |   -e PLUGIN_SCRIPT=whoami \ | ||||||
|   -v $(pwd)/$(pwd) \ |   -v $(pwd):$(pwd) \ | ||||||
|   -w $(pwd) \ |   -w $(pwd) \ | ||||||
|   plugins/ssh |   plugins/ssh | ||||||
| ``` | ``` | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Bo-Yi Wu
						Bo-Yi Wu