Using SSH keys but still prompted for git account’s password
I have a GitLab CE instance running, v14.4.2, on an ALMALinux 8.4 (RHEL-variant) virtual machine.
I also have a CentOS 8.5 machine, where I write my code. that I installed the git software on and have created SSH keys on; this is installed with git-2.27.0-1.el8.x86_64.
A change that I made, for the purpose of troubleshooting:
I set the SELINUX mode on the GitLab Server (a8-gitsrv.snelheid.lab) to permissive.
I rebooted the server and waited a few minutes for the machine to boot and be stable.
I went back to my dev machine and executed the git clone command: git clone git@a8-gitsrv.snelheid.lab:wfrench/dummy001.git
That was successful.
What lead me to this action was reviewing the /var/log/messages file and finding the following output:
Nov 20 11:50:09 a8-gitsrv setroubleshoot[120515]: SELinux is preventing /usr/sbin/sshd from read access on the file authorized_keys.#012#012***** Plugin catchall_labels (83.8 confidence) suggests *******************#012#012If you want to allow sshd to have read access on the authorized_keys file#012Then you need to change the label on authorized_keys#012Do#012# semanage fcontext -a -t FILE_TYPE ‘authorized_keys’#012where FILE_TYPE is one of the following: NetworkManager_etc_rw_t, NetworkManager_etc_t, NetworkManager_tmp_t, abrt_etc_t, abrt_helper_exec_t, abrt_tmp_t
I would like to re-enable the firewalld service and also set SELINUX to enforcing.