summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2016-03-15 23:02:31 (EDT)
committer P. J. McDermott <pj@pehjota.net>2016-03-15 23:02:31 (EDT)
commit175d90d1b1521d9ed11bb35548111d29a4455f07 (patch)
treeb019fedd31838bdff3e71cba0865952cb325412b
parent179ad111a53826cc439b51926327ffc318848ea7 (diff)
downloadpc-inst-175d90d1b1521d9ed11bb35548111d29a4455f07.zip
pc-inst-175d90d1b1521d9ed11bb35548111d29a4455f07.tar.gz
pc-inst-175d90d1b1521d9ed11bb35548111d29a4455f07.tar.bz2
Copy keys
-rw-r--r--hosts/alsvid20010
1 files changed, 7 insertions, 3 deletions
diff --git a/hosts/alsvid200 b/hosts/alsvid200
index 0a83067..298f2f5 100644
--- a/hosts/alsvid200
+++ b/hosts/alsvid200
@@ -208,9 +208,13 @@ do_postinst()
# Generate target's SSH keypair.
rm -f "${target}/home/pj/.ssh/id_rsa" \
"${target}/home/pj/.ssh/id_rsa.pub" || return 1
- in_target ssh-keygen -b 4096 -C pj@alsvid200 -t rsa \
- -f /home/pj/.ssh/id_rsa </dev/null || return 1
- cp "${target}/home/pj/.ssh/id_rsa.pub" 'pj@alsvid200.pub' || return 1
+ install -o pj -g pj -m 0600 '/home/pj/.ssh/id_rsa' \
+ "${target}/home/pj/.ssh/id_rsa" || return 1
+ install -o pj -g pj -m 0600 '/home/pj/.ssh/id_rsa.pub' \
+ "${target}/home/pj/.ssh/id_rsa.pub" || return 1
+ #in_target ssh-keygen -b 4096 -C pj@alsvid200 -t rsa \
+ # -f /home/pj/.ssh/id_rsa </dev/null || return 1
+ #cp "${target}/home/pj/.ssh/id_rsa.pub" 'pj@alsvid200.pub' || return 1
return 0
}