-1

I created a jenkins user with Ansible, when I would connect to the machine its always asking passpharse. I didn't set it. The provided key has no passpharse

Here is the user creation:

- name: Create Jenkins user
  user:
    name: jenkins
    state: present
    shell: /bin/bash
    home: /home/jenkins
  tags:
    - debug

- name: Set authorized key for Jenkins user
  authorized_key:
    user: jenkins
    state: present
    key: https://mystorage.blob.core.windows.net/config/{{ env }}id_rsa.pub
  tags:
    - debug

After when I would connect to the machine via ssh

ssh -i azureid_rsa.pub jenkins@xxx.xxx.xxx.xxx
Enter passphrase for key '../../../../blob/azureid_rsa.pub':

What is the problem? I didn't set the passpharse and the key hasn't have it.

Shui shengbao
  • 3,503
  • 1
  • 10
  • 20
GergA
  • 149
  • 10

1 Answers1

1

Yes, you should use private key azureid_rsa to login. You could check this link:How Do SSH Keys Work?

SSH key pairs are two cryptographically secure keys that can be used to authenticate a client to an SSH server. Each key pair consists of a public key and a private key.

The private key is retained by the client and should be kept absolutely secret. Any compromise of the private key will allow the attacker to log into servers that are configured with the associated public key without additional authentication. As an additional precaution, the key can be encrypted on disk with a passphrase.

The associated public key can be shared freely without any negative consequences. The public key can be used to encrypt messages that only the private key can decrypt. This property is employed as a way of authenticating using the key pair.

The public key is uploaded to a remote server that you want to be able to log into with SSH. The key is added to a special file within the user account you will be logging into called ~/.ssh/authorized_keys.

Shui shengbao
  • 3,503
  • 1
  • 10
  • 20