---
# System prepended metadata

title: Openshift Create SSH Access after install

---

# Openshift Create SSH Access after install


create ssh key on local machine 

* ssh-keygen -t rsa 

go to root/.ssh and copy the ssh public key

* cd root/.ssh and copy from the terminal


enter the node:

* oc debug node/"node name"

go to host directory 

* chroot /host

go to home/"core"/.ssh if it doesnt exist create it

* cd /home/core/.ssh or mkdir .ssh 

enter the directory and enter authorized_keys file if doesnt exist create it 

* nano authorized_keys

paste the public keys from the local machine created in step 1

* right click and paste and exit the file 

do the same thing with but with id_rsa.pub

* nano id_rsa.pub and paste the pub key 

go to the ssh config file 

* cd /etc/ssh/sshd_config 

uncomment and verify certain lines (if wrong says error pubkey .....)

* PubkeyAuthentication yes 
* PasswordAuthentication yes
* ChallengeResponseAuthentication no

give permissions to directory and files (important) (if wrong asks for password)

* chmod 700 /home/core/.ssh
* chown core /home/core/.ssh
* chgrp core /home/core/.ssh

* chmod 600 /home/core/.ssh/authorized_keys
* chown core /home/core/.ssh/authorized_keys
* chgrp core /home/core/.ssh/authorized_keys

* hmod 600 /home/core/.ssh/id_rsa.pub
* chown core /home/core/.ssh/id_rsa.pub
* chgrp core /home/core/.ssh/id_rsa.pub

and in the local machine 

* chmod 600 /home/core/.ssh/id_rsa

test the connection 

ssh -i id_rsa core@"node ip"