Commit df388ba5 authored by Fedrico Otaran's avatar Fedrico Otaran

Add SSH guides

parent 3c706605
......@@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "markdown",
"id": "alone-toner",
"id": "decimal-montreal",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -19,7 +19,7 @@
},
{
"cell_type": "markdown",
"id": "listed-motion",
"id": "adequate-summary",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -37,7 +37,7 @@
},
{
"cell_type": "markdown",
"id": "natural-filling",
"id": "therapeutic-somalia",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -49,7 +49,7 @@
},
{
"cell_type": "markdown",
"id": "temporal-hepatitis",
"id": "outdoor-excellence",
"metadata": {
"slideshow": {
"slide_type": "fragment"
......@@ -63,7 +63,7 @@
},
{
"cell_type": "markdown",
"id": "forbidden-slovenia",
"id": "sexual-assessment",
"metadata": {
"slideshow": {
"slide_type": "fragment"
......@@ -75,7 +75,7 @@
},
{
"cell_type": "markdown",
"id": "injured-documentation",
"id": "tamil-impact",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -88,7 +88,7 @@
},
{
"cell_type": "markdown",
"id": "lined-vacuum",
"id": "grateful-negative",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -101,7 +101,7 @@
},
{
"cell_type": "markdown",
"id": "instructional-profession",
"id": "dedicated-hungarian",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -114,7 +114,7 @@
},
{
"cell_type": "markdown",
"id": "rental-native",
"id": "cheap-resolution",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -127,7 +127,7 @@
},
{
"cell_type": "markdown",
"id": "happy-steps",
"id": "dental-baseline",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -140,7 +140,7 @@
},
{
"cell_type": "markdown",
"id": "closing-reverse",
"id": "tight-automation",
"metadata": {
"slideshow": {
"slide_type": "fragment"
......@@ -152,7 +152,7 @@
},
{
"cell_type": "markdown",
"id": "moderate-conference",
"id": "grave-webster",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -164,7 +164,7 @@
},
{
"cell_type": "markdown",
"id": "eligible-angel",
"id": "consolidated-convention",
"metadata": {
"slideshow": {
"slide_type": "fragment"
......@@ -179,7 +179,7 @@
},
{
"cell_type": "markdown",
"id": "sensitive-optics",
"id": "secret-assumption",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -191,7 +191,7 @@
},
{
"cell_type": "markdown",
"id": "appreciated-surface",
"id": "crucial-crisis",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -203,7 +203,7 @@
},
{
"cell_type": "markdown",
"id": "advised-champagne",
"id": "hourly-scope",
"metadata": {
"slideshow": {
"slide_type": "fragment"
......@@ -217,7 +217,7 @@
},
{
"cell_type": "markdown",
"id": "buried-period",
"id": "historic-medline",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -241,7 +241,7 @@
},
{
"cell_type": "markdown",
"id": "compliant-travel",
"id": "built-liberia",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -262,7 +262,7 @@
},
{
"cell_type": "markdown",
"id": "democratic-subscription",
"id": "encouraging-franklin",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -276,7 +276,7 @@
},
{
"cell_type": "markdown",
"id": "cross-scene",
"id": "grave-bachelor",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -293,7 +293,7 @@
},
{
"cell_type": "markdown",
"id": "canadian-webcam",
"id": "boolean-lexington",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -316,7 +316,7 @@
},
{
"cell_type": "markdown",
"id": "fifth-interaction",
"id": "comparative-calcium",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -330,7 +330,7 @@
},
{
"cell_type": "markdown",
"id": "freelance-treasury",
"id": "subject-belly",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -349,7 +349,7 @@
},
{
"cell_type": "markdown",
"id": "architectural-writer",
"id": "consolidated-perry",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -369,7 +369,7 @@
},
{
"cell_type": "markdown",
"id": "suspected-imaging",
"id": "ahead-billion",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -385,7 +385,7 @@
},
{
"cell_type": "markdown",
"id": "vocal-tours",
"id": "advance-congress",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -402,7 +402,7 @@
},
{
"cell_type": "markdown",
"id": "written-consciousness",
"id": "swiss-climate",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -424,7 +424,7 @@
},
{
"cell_type": "markdown",
"id": "guilty-edwards",
"id": "ranging-denver",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -440,7 +440,7 @@
},
{
"cell_type": "markdown",
"id": "fuzzy-booth",
"id": "upper-advocacy",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -453,7 +453,7 @@
},
{
"cell_type": "markdown",
"id": "commercial-growth",
"id": "hollywood-means",
"metadata": {
"slideshow": {
"slide_type": "fragment"
......@@ -468,7 +468,7 @@
},
{
"cell_type": "markdown",
"id": "technical-blast",
"id": "altered-cooking",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -482,7 +482,7 @@
},
{
"cell_type": "markdown",
"id": "overhead-niger",
"id": "chief-pattern",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -499,7 +499,7 @@
},
{
"cell_type": "markdown",
"id": "choice-tradition",
"id": "ceramic-theta",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -511,7 +511,7 @@
},
{
"cell_type": "markdown",
"id": "listed-monaco",
"id": "bizarre-message",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -519,7 +519,7 @@
},
"source": [
"Para usar GitHub de forma segura tienes dos opciones:\n",
"1. Generar una clave SSH y agregarla al usuario . \n",
"1. Generar una clave SSH y agregarla al usuario. Guía completa para github [aquí](https://docs.github.com/es/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent) \n",
"2. Usar el método HTTP, pero deberás escribir tu usuario y contraseña para cada operación con el servidor Github.\n",
"\n",
"Con tu cuenta creada debes crear tu repositorio remoto dentro de Github."
......@@ -527,7 +527,7 @@
},
{
"cell_type": "markdown",
"id": "arabic-limitation",
"id": "desirable-spectrum",
"metadata": {
"slideshow": {
"slide_type": "fragment"
......@@ -543,7 +543,7 @@
},
{
"cell_type": "markdown",
"id": "second-wesley",
"id": "built-folks",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -563,7 +563,7 @@
},
{
"cell_type": "markdown",
"id": "informative-compatibility",
"id": "wrapped-launch",
"metadata": {
"slideshow": {
"slide_type": "fragment"
......@@ -576,7 +576,7 @@
},
{
"cell_type": "markdown",
"id": "dominant-program",
"id": "lightweight-aluminum",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -588,7 +588,7 @@
},
{
"cell_type": "markdown",
"id": "nominated-majority",
"id": "expired-barbados",
"metadata": {
"slideshow": {
"slide_type": "fragment"
......@@ -610,7 +610,7 @@
},
{
"cell_type": "markdown",
"id": "undefined-carolina",
"id": "finite-situation",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -631,7 +631,7 @@
},
{
"cell_type": "markdown",
"id": "international-shield",
"id": "robust-forestry",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -650,7 +650,7 @@
},
{
"cell_type": "markdown",
"id": "assumed-inspection",
"id": "guided-israel",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -668,7 +668,7 @@
},
{
"cell_type": "markdown",
"id": "statewide-madrid",
"id": "dried-lawsuit",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -688,7 +688,7 @@
},
{
"cell_type": "markdown",
"id": "romantic-weapon",
"id": "affected-shoulder",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -706,7 +706,7 @@
},
{
"cell_type": "markdown",
"id": "behavioral-screw",
"id": "seventh-encounter",
"metadata": {
"slideshow": {
"slide_type": "slide"
......@@ -723,7 +723,7 @@
},
{
"cell_type": "markdown",
"id": "commercial-cream",
"id": "compact-johnston",
"metadata": {},
"source": [
"### Info\n",
......
{
"cells": [
{
"cell_type": "markdown",
"id": "reduced-grove",
"metadata": {},
"source": [
"# SSH\n",
"\n",
"La idea de esta guía es generar una clave ssh en la máquina en donde vamos a\n",
"trabajar durante la cursada para luego agregarla a el servidor Gitlab.\n",
"Con este método de seguridad vamos a evitar tener que completar usuario y clave\n",
"cada vez que realicemos una operación hacia el servidor.\n",
"\n",
"## Requisitos\n",
"\n",
"Para la generación de clave necesitamos ejecutar el comando `ssh-keygen`. El\n",
"mismo viene instalado en las distribuciones más comunes de linux. Para el caso\n",
"de windows cuando instalen git van a obtener la consola Git Bash.\n",
"\n",
"## Generación de clave\n",
"\n",
"Para generar la clave ssh deberá ejecutar el siguiente comando:\n",
"\n",
"```bash\n",
"ssh-keygen -t rsa -b 2048 -C \"email@example.com\"\n",
"```\n",
"\n",
"> Recuerda poner tu email en lugar de usar \"email@example.com\".\n",
"\n",
"Se debe visualizar una respuesta similar a:\n",
"\n",
"```bash\n",
"Generating public/private rsa key pair.\n",
"Enter file in which to save the key (/home/user/.ssh/id_rsa):\n",
"```\n",
"\n",
"Presione la tecla Enter para guardar las llaves en el subdirectorio `.ssh/`\n",
"dentro del directorio de su usuario. Sino puede completar una ruta alternativa.\n",
"\n",
"Luego de guardar la clave le pedirá que inserte in passphrase como una instancia\n",
"más de seguridad.\n",
"\n",
"```bash\n",
"Enter passphrase (empty for no passphrase):\n",
"Enter same passphrase again:\n",
"```\n",
"\n",
"Este passphrase no es obligatorio así que puede dejarlo en blanco\n",
"pulsando nuevamente la tecla Enter.\n",
"\n",
"> Si necesita cambiar esta passphrase en algún momento puede ejecutar el siguiente \n",
"> comando\n",
">\n",
"> ```bash\n",
"> ssh-keygen -p -f /path/to/ssh_key\n",
"> ```\n",
"\n",
"Cuando el comando finaliza debería mostrarle una salida similar a la siguiente:\n",
"\n",
"```bash\n",
"Your identification has been saved in /your_home/.ssh/id_rsa.\n",
"Your public key has been saved in /your_home/.ssh/id_rsa.pub.\n",
"The key fingerprint is:\n",
"a9:49:2e:2a:5e:33:3e:a9:de:4e:77:11:58:b6:90:26 mail@example.com\n",
"The key's randomart image is:\n",
"+--[ RSA 2048]----+\n",
"| ..o |\n",
"| E o= . |\n",
"| o. o |\n",
"| .. |\n",
"| ..S |\n",
"| o o. |\n",
"| =o.+. |\n",
"|. =++.. |\n",
"|o=++. |\n",
"+-----------------+\n",
"```\n",
"\n",
"Tus claves fueron generadas en el directorio `/your_home/.ssh`:\n",
"\n",
"- `/your_home/.ssh/id_rsa.pub` es tu clave pública, y la que deberás\n",
"configurar en los servicios que quieras hacer uso con este mecanismo.\n",
"- `/your_home/.ssh/id_rsa`, es tu clave privada. Es importante que no pierdas\n",
"nunca este archivo ya que no vas a poder recuperarlo. Además tampoco debes\n",
"compartir el mismo ya que cualquier persona con dicha clave podría tomar tu\n",
"identidad.\n",
"\n",
"En nuesto caso, la clave pública deberá ser configurada en el servicio de\n",
"**Gitlab** para autenticarnos de forma automática a la hora de interactuar con\n",
"el repositorio. Esto evita que tengamos que ingresar usuario y clave en cada\n",
"operación."
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
{
"cells": [
{
"cell_type": "markdown",
"id": "desirable-manufacturer",
"metadata": {},
"source": [
"# Agregar la clave SSH en Gitlab\n",
"\n",
"1. Primero necesitamos crear nuestra clave SSH y copiarla en el clipboard. Esto\n",
" se puede ver en [esta guía](02_ssh.md).\n",
"2. Luego debe ir al Gitlab de la cátedra https://gitlab.catedras.linti.unlp.edu.ar/\n",
" e iniciar sesión.\n",
"3. Selecciona en tu avatar en la esquina superior derecha y hace click en\n",
" **Cónfiguración**.\n",
" ![Imgur](https://i.imgur.com/6kb8Sd0.jpg)\n",
"4. Selecciona **Claves SSH**.\n",
"5. Pega la clave pública que copiaste en el paso uno en el textarea.\n",
"6. Asegurate de incluir un nombre descriptivo a tu clave en el input **Título**,\n",
" como *PC de casa*.\n",
"7. Opcionalmente se puede poner una fecha de expiración a la clave.\n",
"8. Selecciona el botón **Añadir clave**\n",
"\n",
" ![Imgur](https://i.imgur.com/b7iCbB1.jpg)\n"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment