Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagenone
sudo mkdir -p /home/fixicc-h2/.ssh
  1. Set the permissions (the owner has read, write, and execute permissions, and no one else has any permissions) temporary permissions for the .ssh directory

Code Block
sudo chmod 700777 /home/fixicc-h2/.ssh
  1. Scan the SSH keys from the remote server and append them to known_hosts

Code Block
sudo ssh-keyscan -H git.epam.com >> /home/fixicc-h2/.ssh/known_hosts

...

known_hosts

...

Code Block
sudo chmod 600 /home/fixicc-h2/.ssh/known_hosts
  1. Generate the SSH key pair

Code Block
ssh-keygen -t rsa -m PEM -f /home/fixicc-h2/.ssh/id_rsa
  1. Change the ownership of the .ssh directory and its contents

Code Block
sudo chown -R fixicc-h2:fixicc-h2 /home/fixicc-h2
  1. Set the permissions (the owner has read and write permissions, and no one else has any permissions) for the known_hosts file and for the .ssh directory (the owner has read, write, and execute permissions, and no one else has any permissions):

Code Block
sudo chmod 700 /home/fixicc-h2/.ssh
sudo chmod 600 /home/fixicc-h2/.ssh/known_hosts
  1. Add the SSH key to GitLab. The SSH key (public) can be obtained with the following command

Code Block
sudo cat /home/fixicc-h2/.ssh/id_rsa.pub
Go to GitLab SSH Key Settings(e.g. https://git.epam.com/-/profile/keys) 
Add the generated SSH key

...