Skip to content

Instantly share code, notes, and snippets.

@ederrafo
Last active September 14, 2020 03:17
Show Gist options
  • Save ederrafo/ff3001c1245bc1046a310b1fdcc1cf9e to your computer and use it in GitHub Desktop.
Save ederrafo/ff3001c1245bc1046a310b1fdcc1cf9e to your computer and use it in GitHub Desktop.
linux ssh

SSH Es un protocolo para conectarnos a servers desde nuestra maquina local.

$ ssh -V
$ which ssh

ssh-keygen command

El comando ssh-keygen nos permite generar llaves publicas y privadas en nuestro so para conectarnos remotamente o permitir que otros se conecten a nuestra maquina

ssh-copy-id command

ssh-copy-id moves the public key file specified with -i ~/.ssh/<public_key_file> from your computer to . It will be stored in the file ~/.ssh/authorized_keys in the directory of .

// Generate keys
$ ssh-keygen -b 4096

// Move the public key to the remote machine
$ ssh-copy-id -i id_rsa.pub [email protected]

Connect to server with key

// ssh -i [Nombre de la llave] [usuario]@[ip del servidor]

$ ssh -i ederrafo.pem [email protected]

Your key file must not be publicly viewable for SSH to work. Use this command if needed: chmod 400 mykey.pem

$ chmod 400 mykey.pem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment