Skip to content

Instantly share code, notes, and snippets.

@markuswustenberg
Created November 10, 2009 17:42
Show Gist options
  • Save markuswustenberg/231071 to your computer and use it in GitHub Desktop.
Save markuswustenberg/231071 to your computer and use it in GitHub Desktop.
A little script to send yubikey keys (or any input string) over network.
#!/bin/sh
# Port to send message to
PORT=9999
# IP address of destination machine
DESTIP="127.0.0.1"
# Use UDP
NETCAT_CMD="nc -w 1 -n -u $DESTIP $PORT"
# Use TCP
#NETCAT_CMD="nc -w 1 $DESTIP $PORT"
while (true)
do
read KEY
echo "Got key $KEY"
echo $KEY | $NETCAT_CMD
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment