Saltar al contenido

configurar ssh key ejemplo de código de gitlab

No busques más por todo internet porque llegaste al espacio exacto, tenemos la solución que quieres sin complicaciones.

Ejemplo 1: ssh gitlab

1)OpenGitBash(Download and InstallGitBash;You can use any *nix based command prompt).2)Type

 cd ~/.sshThis will take you to the root directory forGit(LikelyC:Users[YOUR-USER-NAME].ssh on Windows).3)In the .ssh folder you should find these two files: id_rsa and id_rsa.pub.These files tell the computer how to communicate withGitHub,BitBucket, or any other Git based service.Those files were obviously missing from my computer so I had to create them.ssh-keygen -t rsa -C"[email protected]"Typethis to create those two files
Once you entered that command, you will get a few more questions:Enter file in which to save the key(/home/demo/.ssh/id_rsa):You can press enter here, saving the file to the user home(inthiscase, my example user is called demo).Thenthis will be shown:Enterpassphrase(empty for no passphrase):The only downside,of course, to having a passphrase, is then having to type it in each time you use the key pair.I suggest you to use a passphrase though, due to security concerns.In the end, the entire process looks like this:Enter file in which to save the key(/home/demo/.ssh/id_rsa):Enterpassphrase(empty for no passphrase):Enter same passphrase again:Your identification has been saved in/home/demo/.ssh/id_rsa.Yourpublic key has been saved in/home/demo/.ssh/id_rsa.pub.The key fingerprint is:4a:dd:0a:c6:35:4e:3f:ed:27:38:8c:74:44:4d:93:67[email protected]The key's randomart image is:+--[RSA2048]----+|.oo.||.o.E||+.o||.==.||=S=.||     o +=+||.o+ o .||.o|||+-----------------+Thepublic key is now located in/home/demo/.ssh/id_rsa.pub.Theprivatekey(identification) is now located in/home/demo/.ssh/id_rsa.4)Copying the public key to GitLabGo and open the id_rsa.pubfile(you can use any text editor you want).Copy the entire content of that file and then open https://gitlab.com/profile/keys.HowGitLabSSHKeys page looks

Paste the content you copied from id_rsa.pubin the Keyinput(don't add extra spaces or characters).Give your key a descriptive name and then Add the key.5)Try to git clone or git push.I really hope this will help someone because this article is what I needed last week when I couldn't put things together and all seemed to be way harder than it actually is.

Ejemplo 2: agregar ssh key a gitlab

#1-OpenGitLab and go to your account settings
#2-Click on SSH.
#3-Click on AddSSHKey

Sección de Reseñas y Valoraciones

Si para ti ha resultado de provecho nuestro artículo, sería de mucha ayuda si lo compartes con más seniors de esta forma nos ayudas a dar difusión a esta información.

¡Haz clic para puntuar esta entrada!
(Votos: 0 Promedio: 0)



Utiliza Nuestro Buscador

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *