-
Notifications
You must be signed in to change notification settings - Fork 1
Git SSH
procedura per lavorare con github via ssh senza l'utilizzo del tuo username e password aprire il terminale e assicurarsi di essere nella home:
1- $ssh -v l'output deve essere simile a OpenSSH_5.6p1, OpenSSL 0.9.8r 8 Feb 2011 usage: ssh [-1246AaCfgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec] [-D [bind_address:]port] [-e escape_char] [-F configfile] [-I pkcs11] [-i identity_file] [-L [bind_address:]port:host:hostport] [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port] [-R [bind_address:]port:host:hostport] [-S ctl_path] [-W host:port] [-w local_tun[:remote_tun]] [user@]hostname [command]> (se non è cosi installare ssh)
2- ssh-keygen invio alla prima richiesta alla seconda dare una password a scelta l'output dovrebbe essere simile a: Generating public/private rsa key pair. Enter file in which to save the key (/Users/emmap1/.ssh/id_rsa): Created directory '/Users/emmap1/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /Users/emmap1/.ssh/id_rsa. Your public key has been saved in /Users/emmap1/.ssh/id_rsa.pub. The key fingerprint is: 4c:80:61:2c:00:3f:9d:dc:08:41:2e:c0:cf:b9:17:69 emmap1@myhost.local The key's randomart image is: +--[ RSA 2048]----+ |*o+ooo. | |.+.=o+ . | |. . o . | | . = E o | | o . S | | . . | | . | | | | | +-----------------+
3- controllare se nella cartella .ssh si sono creati 2 file id_rsa e id_rsa.pub (può essere presente un terzo file)
4- $ ps -e | grep [s]sh-agent l'output dovrebbe essere del tipo: 9060 ?? 0:00.28 /usr/bin/ssh-agent -l 4.1 se non dovesse essere cosi fare: $ ssh-agent /bin/bash
5- $ ssh-add ~/.ssh/id_rsa quando richiedono una password dare quella precedente
6- $ ssh-add -l l'output dovrebbe essere simile a: 2048 7a:9c:b2:9c:8e:4e:f4:af:de:70:77:b9:52:fd:44:97 /Users/manthony/.ssh/id_rsa (RSA)
7- $ gedit ~/.ssh/id_rsa.pub e copiarne il contenuto aprire github e inserire in accout->settings->SSH keys la chiave
8- copiare l'url del repo sul quale si vuole copiare (selezionare ssh)
9- aprire la cartella in cui si vuole posizionare il repo locale e dare da terminale il comando $ git clone url@copiato
per info https://confluence.atlassian.com/bitbucket/set-up-ssh-for-git-728138079.html