Skip to content

Instantly share code, notes, and snippets.

@udkyo
Created February 13, 2019 13:48
Show Gist options
  • Save udkyo/a89099b1c84fa96ac7a076f880851207 to your computer and use it in GitHub Desktop.
Save udkyo/a89099b1c84fa96ac7a076f880851207 to your computer and use it in GitHub Desktop.
nc webserver
# I use this for quickly getting SSH pub keys from one host to another in the lab
# when I've provisioned them an awkward way, running this and then something along the lines of
# mkdir ~/.ssh && chmod 755 ~/.ssh && curl [host_with_key] >> ~/.ssh/authorized_keys
while true; do nc -l -p 1500 -c 'echo -e "HTTP/1.1 200 OK\n\n$(cat ~/.ssh/id_rsa.pub)"'; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment