Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1872127

Summary: Not able to ssh to the node using created ssh key-pair as part of install-config
Product: OpenShift Container Platform Reporter: Praveen Kumar <prkumar>
Component: RHCOSAssignee: Micah Abbott <miabbott>
Status: CLOSED DUPLICATE QA Contact: Michael Nguyen <mnguyen>
Severity: high Docs Contact:
Priority: unspecified    
Version: 4.6CC: bbreard, bgilbert, imcleod, jligon, nstielau
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-08-25 11:49:18 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Praveen Kumar 2020-08-25 06:55:42 UTC
Description of problem:
I am testing http://mirror.openshift.com/pub/openshift-v4/clients/ocp-dev-preview/4.6.0-fc.2/ with libvirt provider and providing the ssh public key as part of install-config but once the master is up and I try to ssh using the respective private key, it always error out with permission error, Is something changed recently regarding it (either on installer side or RHCOS side)?


Version-Release number of selected component (if applicable):
- 4.5.0-fc.2


Steps to Reproduce:
- Create a ssh key pair ($ ssh-keygen -N "" -f id_rsa_crc -C "core")
- Create the install-config using libvirt provider ( $ openshift create install-config)
- Update the ssh key to generated ssh public key
- Create the cluster using that install-config file
- wait till master is available
- Try to ssh to the master using private key which is generated in step-1

Actual results:

```
$ ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i id_rsa_crc core.testing
Warning: Permanently added 'api.crc.testing,192.168.126.11' (ECDSA) to the list of known hosts.
core.testing: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
```

Expected results:

Should able to ssh to the node.

Additional info:
If I debug the node and then check the `iginiton` key in the `authorized_keys.d` directory that looks as expected (have the same public key content which we created.)

```
$ oc debug node/crc-hn6hh-master-0
Starting pod/crc-hn6hh-master-0-debug ...
To use host binaries, run `chroot /host`
Pod IP: 192.168.126.11
If you don't see a command prompt, try pressing enter.

sh-4.2# chroot /host

sh-4.4# ls -l /home/core/.ssh/authorized_keys.d/ignition 
-rw-------. 1 core core 558 Aug 25 06:02 /home/core/.ssh/authorized_keys.d/ignition

sh-4.4# cat /home/core/.ssh/authorized_keys.d/ignition 
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC93u9wb/QYZXxU76R3ZY2Ii+tNv2mEYKCWgKxQobqLwBzdVDqbzZ0p7OFhj7VRBT+XoQ7EVQROMxowCWYSxOBQUnVSvshNkQLVHZD0giu1tQkNE71axLNAhS/23wsWSEPu4+k0IyDluKL0fGAHYLPPPM5RIBhZQzOTKn/U0hR2EIlkSgF8/5Lb56mpoM1dOSC85LilwH3hLUI1n0JTwu5bEgYrrNwX2tpIVjHU58Lh0pawIgutxq4/dekDvZTTvicSVli7CpHdfA6+oRocM2vz4eLAHz6jgTe4X2vsE2pQuxb/Tk7Nj5YRyb2mWzrsCQBl/+/eLtzgnu+uCvgggE46c6RdYkg7KrXPZZ1KvlygOfjP3SZDJhZCzoxMIpZPp2arNKSPnwR+DfcgNnlFYQAwJsnWqB6mW0tCEkhQ6LQZ5Xht0WgsqwXn+VpP6jjP/QvAdR1T8PkXStQ5o52H3YYvu/72OUio5YL5EyHoSIm0P0JOprbwuflO3n8elWnwKEc= core
```

Comment 1 Benjamin Gilbert 2020-08-25 11:49:18 UTC

*** This bug has been marked as a duplicate of bug 1871795 ***