DEV Community

Kesio
Kesio

Posted on

2

Настройка ssh на linux для GitHub.

Всем привет. Чтобы клонировать свои репозитории на удаленные сервера нужно выполнить всего несколько шагов. Приятного чтения.

1 - Создание ключ пары

Для начала вам нужно сгенерировать два ключа для ssh, один публичный и один приватный.

ssh-keygen -t ed25519
Enter fullscreen mode Exit fullscreen mode

Нажимаем enter несколько раз.
После этого в вашей домашней директории появится папка .ssh, переходим в нее

2 - Создание конфигурации

Создаем в папке .ssh файл config

nano config
Enter fullscreen mode Exit fullscreen mode

В нее вставляем вот такой конфиг:

Host github.com
 HostName github.com
 IdentityFile ~/.ssh/id_ed25519
 IdentitiesOnly yes
Enter fullscreen mode Exit fullscreen mode

А теперь сохраняем файл. Если вы никогда не пользовались nano то вам сюда тык

после копируем данные с id_ed25519.pub с помощью cat

cat id_ed25519.pub
Enter fullscreen mode Exit fullscreen mode

после получаем вот такой текст

ssh-ed25519 AAAAC3N...LpPG kesio@pc
Enter fullscreen mode Exit fullscreen mode

копируем его и идем в github, заходим в настройки, ищем пункт
SSH and GPG keys

далее нажимаем на New SSH key в поле title пишите для вас удобное название подключения и в нижнее поле тот самый ключ.

Готово! теперь у вас подключен ваш github аккаунт к пк/серверу.

Image of Docusign

Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay