ОС: Ubuntu с ВМ Windows 10
Цель: настроить git bash на виртуальной машине Windows 10 с ключом ssh для использования с частным Bitbucket.
Обзор. Создание ключа SSH в расположении, отличном от используемого по умолчанию, для работы с git bash не сработало. Попыткой решения было создать местоположение по умолчанию и переместить ключ в это место для проверки. Я недостаточно знаю, как генерируется местоположение по умолчанию или как git bash ищет sshkey для сравнения с битбакетом. Я подозреваю, что на проблему могут влиять сетевые диски/ИТ, но я не знаю, какие вопросы задавать. Шаги и подробности ниже. Да, ключ ssh был добавлен в учетную запись Bitbucket.
При создании ключа ssh предлагаемое местоположение — /home/username/.ssh... Я не уверен, откуда берется этот предлагаемый путь. Я настроил несколько компьютеров с ключами git bash/ssh, и этот предлагаемый путь различается. Как устанавливается предлагаемый путь? и Как устанавливается путь поиска ключа ssh?
ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/plane/.ssh/id_rsa): /c/Users/username/.ssh/id_rsa
~ pwd = c/Users/username
/ существует, но home не существует
$ ls -l /
total 3076
drwxr-xr-x 1 username 1061577 0 Feb 3 15:57 bin/
drwxr-xr-x 1 username 1061577 0 Feb 3 15:57 cmd/
drwxr-xr-x 1 username 1061577 0 Feb 3 15:57 dev/
drwxr-xr-x 1 username 1061577 0 Feb 3 15:57 etc/
-rwxr-xr-x 1 username 1061577 152112 Jan 13 20:31 git-bash.exe*
-rwxr-xr-x 1 username 1061577 151600 Jan 13 20:31 git-cmd.exe*
-rw-r--r-- 1 username 1061577 18765 Dec 10 18:25 LICENSE.txt
drwxr-xr-x 1 username 1061577 0 Feb 3 15:56 mingw64/
dr-xr-xr-x 13 username 1061577 0 Feb 3 17:57 proc/
-rw-r--r-- 1 username 1061577 160771 Jan 13 21:08 ReleaseNotes.html
drwxr-xr-x 1 username 1061577 0 Feb 3 17:02 tmp/
-rw-r--r-- 1 username 1061577 1161914 Feb 3 15:57 unins000.dat
-rwxr-xr-x 1 username 1061577 1299888 Feb 3 15:51 unins000.exe*
-rw-r--r-- 1 username 1061577 22795 Feb 3 15:57 unins000.msg
drwxr-xr-x 1 username 1061577 0 Feb 3 15:57 usr/
Разрешения запрещены
mkdir -p /home/username
mkdir: cannot create directory ‘/home’: Permission denied
Гит-клон:
$ git clone ssh://[email protected]/project.git
Cloning into 'project'...
Could not create directory '/home/username/.ssh'.
The authenticity of host 'example' can't be established.
RSA key fingerprint is SHA256.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Failed to add the host to the list of known hosts (/home/username/.ssh/known_hosts).
example: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Редактировать:
Я также попытался сделать следующее.
Чтобы указать, где на самом деле находится .ssh и где я хочу, чтобы он был. /c/Users/plane/.ssh
git config --global core.sshCommand "ssh -i ~/.ssh/id_rsa.pub"
1) Не удалось создать '/home/plane/.ssh'
2) Не удалось добавить хост в список известных хостов (/home/plane/.ssh/known_hosts).
3) Загрузить ключ "/c/Users/plane/.ssh/id_rsa.pub": неверный формат
git clone ssh://[email protected]
Cloning into 'project'...
Could not create directory '/home/plane/.ssh'.
The authenticity of host can't be established.
RSA key fingerprint is SHA256:.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Failed to add the host to the list of known hosts (/home/plane/.ssh/known_hosts).
Load key "/c/Users/plane/.ssh/id_rsa.pub": invalid format
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Спасибо,