Mam pytanie. Generując klucze ssh teoretycznie moge ich wygenerowac kilka kompletów podając podczas generowania lokalizację, gdzie mają zostac umieszczone. Domyślnie to jest .ssh/id_rsa
Wygenerowałam w ten sposób klucz, połączyłam się gitem z repozytorium za pomoca tego klucza i pięknie działa. Poblem w tym, ze na tym samym serwerze (bitbucket) mam jeszcze jedno konto do którego też się chcę łączyć, ale nie mogę użyć tego samego klucza ssh. Jak tworze klucz w innym pliku i go dodaję do profilu na bitbucket to niestety nie działa mi to połączenie. Jak to rozwiązać?
klucze ssh - używanie różnych kluczy
- mario_7
- Administrator
- Posty: 8606
- Rejestracja: 30 sie 2006, 13:11
- Płeć: Mężczyzna
- Wersja Ubuntu: 20.04
- Środowisko graficzne: GNOME
- Architektura: x86_64
Re: klucze ssh - używanie różnych kluczy
Wskazałeś w połączeniu SSH aby skorzystał z innego klucza niż domyślny?
Można to też ustawić w pliku konfiguracyjnym SSH.
Można to też ustawić w pliku konfiguracyjnym SSH.
- jacekalex
- Gibki Gibbon
- Posty: 4678
- Rejestracja: 17 cze 2007, 02:54
- Płeć: Mężczyzna
- Wersja Ubuntu: inny OS
- Środowisko graficzne: MATE
- Architektura: x86_64
Re: klucze ssh - używanie różnych kluczy
RTFM:man ssh_config pisze:IdentityFile
Specifies a file from which the user's DSA, ECDSA, Ed25519 or RSA
authentication identity is read. The default is ~/.ssh/identity
for protocol version 1, and ~/.ssh/id_dsa, ~/.ssh/id_ecdsa,
~/.ssh/id_ed25519 and ~/.ssh/id_rsa for protocol version 2.
Additionally, any identities represented by the authentication
agent will be used for authentication unless IdentitiesOnly is
set. If no certificates have been explicitly specified by
CertificateFile, ssh(1) will try to load certificate information
from the filename obtained by appending -cert.pub to the path of
a specified IdentityFile.
The file name may use the tilde syntax to refer to a user's home
directory or one of the following escape characters: ‘%d’ (local
user's home directory), ‘%u’ (local user name), ‘%l’ (local host
name), ‘%h’ (remote host name) or ‘%r’ (remote user name).
It is possible to have multiple identity files specified in con‐
figuration files; all these identities will be tried in sequence.
Multiple IdentityFile directives will add to the list of identi‐
ties tried (this behaviour differs from that of other configura‐
tion directives).
IdentityFile may be used in conjunction with IdentitiesOnly to
select which identities in an agent are offered during authenti‐
cation. IdentityFile may also be used in conjunction with
CertificateFile in order to provide any certificate also needed
for authentication with the identity.
Kod: Zaznacz cały
man ssh_config
Przykład konfigu dla konkretnego hosta:
Potem łączysz się poleceniem:Host abw
Protocol 2
StrictHostKeyChecking yes
ForwardX11 no
Compression yes
BatchMode yes
User root
Port 22
IdentityFile ~/.ssh/abw_rsa
HostName abw.gov.pl
CompressionLevel 9
Kod: Zaznacz cały
ssh abw
Problemy rozwiązujemy na forum nie na PW -> Niech inni na tym skorzystają.
Komputer jest jak klimatyzacja - gdy otworzysz okna, robi się bezużyteczny...
Linux User #499936
Inny OS: Gentoo Linux
Komputer jest jak klimatyzacja - gdy otworzysz okna, robi się bezużyteczny...
Linux User #499936
Inny OS: Gentoo Linux
Kto jest online
Użytkownicy przeglądający to forum: Obecnie na forum nie ma żadnego zarejestrowanego użytkownika i 101 gości