...
Code Block | ||
---|---|---|
| ||
sudo mkdir -p /home/fixicc-h2/.ssh |
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 |
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 |
Generate the SSH key pair
Code Block |
---|
ssh-keygen -t rsa -m PEM -f /home/fixicc-h2/.ssh/id_rsa |
Change the ownership of the .ssh directory and its contents
Code Block |
---|
sudo chown -R fixicc-h2:fixicc-h2 /home/fixicc-h2 |
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 |
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 |
...