I was trying to create integration between Jenkins and GitLab using this tutorial: https://docs.bitnami.com/aws/how-to/create-ci-pipeline/
(without Step 3: Connect Your Project With The GitLab Repository)
So I have generated public and private keys, public was added in GitLab (Settings > SSH Keys) and private key file content was inserted into text area in Jenkins Project settings (Source Code Management > Credentials > SSH Username with private key > Private key)
After that following error appeared:
what can cause such strange issue? Thanks for help :)
If you add public key to the profile of a specific GitLab user, you must:
Grant this user access to target project in GitLab.
Use username of that specific user (instead of the git username) when creating the SSH credentials in Jenkins.
Related
Code:
- task: SSH#0
displayName: 'Run shell inline on remote machine'
inputs:
**sshEndpoint: username#server.com**
runOptions: inline
inline: |
cd /
/usr/documents/mql
push context user random pass random;
print context;
I am having issues trying to figure out how to add the password and port to the sshEndpoint input.. there's no documentation on syntax that I'm able to find!If you have tips on where to find these documentations pls lmk
According to your description, you are using SSH task in YAML pipelines. For more about this task, please refer to this following document:
SSH Deployment task - Azure Pipelines | Microsoft Docs.
To use the task, you could fill a SSH service connection name in the sshEndpoint input. The task will try to access the remote machine with the service connection settings.
First, you need to create a SSH service connection. Please navigate to Project settings and then click into the Service connections tab. You could create a new service connection as below:
In the service connection, please add your host, port, username and password. Alternatively, you could also choose to use the private key file to get authentication. It's optional.
When the service connection is created, you could copy the service connection name and paste it into the sshEndpoint input. Please see the example below.
- task: SSH#0
displayName: 'Run shell inline on remote machine'
inputs:
sshEndpoint: 'my_service_connection_name'
runOptions: inline
inline: |
cd / && ls
I want to create pipeline with services. Let's say using mysql service
services:
- mysql:latest
My project uses docker image from our company repo which is password protected.
When I run it manually I must fist login to repository
docker login <creadentials> <repository address>
docker pull <some private image>
Is there some way to configure gitlab pipeline to use service with credentials?
services:
- <maybe some credentials here???>#<my private host>/modifiedForProductionMysql:latest
I know I can use shell runner and call all commands in my shell script. First I wanted to investigate if it is doable with gitlab docker runner and pipeline job with services.
See Using a private container registry. You can put your credentials into DOCKER_AUTH_CONFIG variable. The format is the same as ~/.docker/config.json after you login to your registry.
I am able to call gpg installed on the SAP application server and run commands like --help successfully. All public keys have been trusted and the encryption works from the command prompt on the Windows server. However, when I try to encrypt a file from SAP via SM69 I receive error "skipped: No public key".
I am using WinSCP to automate the copy process to server and the authentication is only with username and password.
Script is:
open username:password#ipaddress:portno -hostkey=<hostkey>
Whereas now the authentication mode has to be changed to public key.
Script changed for authenticate through public key:
open username#ipaddress:portno -privatekey=mykey.ppk
Passphrase for the private key is requested after executing the above script, but is there any way that the passphrase of the private key can be provided in the same command?
Use the -passphrase switch of the open command.
See also WinSCP FAQ
How can I connect without entering private key passphrase each time?
Also, note, that you still should use the -hostkey switch.
open username:password#ipaddress:portno -hostkey=... -privatekey=... -passphrase=...
My client provided me public key and asked me to do a ssh login. But i havent done any ssh login before. So can you please suggest me how to use public key for ssh login. I am using putty on windows
Here is a very nice tutorial on how to setup key based authentication usint putty on Windows.
http://www.ualberta.ca/CNS/RESEARCH/LinuxClusters/pka-putty.html
With SSH, public key is stored on the server and a user must have corresponding private key to log in. If this is your situation, you can specify your private key with PuTTY in one of two ways:
Configuration -> Connection -> SSH -> Auth -> Private key file for authentication
Use -i command-line option when starting PuTTY.
In both cases you need the private key in PuTTY format (.ppk). If your key is in a different format, you'll have to convert it using PuttyGen.