blob: a7788a28f1750329450ee60cc531e25722104610 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
#!/bin/bash
#
# Send both public and private keys to a server.
#
KEY="$1"
SERVER="$2"
DESTKEY="~/.ssh/`basename $KEY`"
# Put on authorized_keys
#cat $KEY | ssh $SERVER "mkdir -p ~/.ssh && chmod 700 ~/.ssh && touch ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys && cat >> ~/.ssh/authorized_keys"
# Public key
cat $KEY.pub | ssh $SERVER "mkdir -p ~/.ssh && chmod 700 ~/.ssh && touch $DESTKEY.pub && chmod 600 $DESTKEY.pub && cat >> $DESTKEY.pub"
# Private key
cat $KEY | ssh $SERVER "mkdir -p ~/.ssh && chmod 700 ~/.ssh && touch $DESTKEY && chmod 600 $DESTKEY && cat >> $DESTKEY"
|