Skip to content

Instantly share code, notes, and snippets.

@fabiocruzcoelho
Created February 7, 2017 20:16
Show Gist options
  • Save fabiocruzcoelho/6bf25e2fd08fbdaace28f187eb2f25b6 to your computer and use it in GitHub Desktop.
Save fabiocruzcoelho/6bf25e2fd08fbdaace28f187eb2f25b6 to your computer and use it in GitHub Desktop.
Comando para Gerar chaves SSH
# Comando para gerar chave por usuario
ssh-keygen -t rsa -b 2048 -v -f keyname
# Comando para copia entre o servidores
ssh-copy-id -i keyname.pub username@servidor.exemplo.local
# Sincroniza aruivos sem pedir senha
rsync -avz -e "ssh -i /homeuser/.ssh/keyname" username@servidor_ou_ip:/origem/ /destino
# Sincroniza arquivos excluindo tudo que iniciar com . (Arquivos ocultos) sem pedir senha
rsync -avz --delete --exclude=".*" -e "ssh -i /homeuser/.ssh/keyname" /origem/ username@ip_servidor:/destino
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment