summaryrefslogtreecommitdiff
path: root/contrib/ssh-copy-id
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2012-08-24 06:51:20 +0100
committerColin Watson <cjwatson@debian.org>2012-08-24 06:51:20 +0100
commit01f52391c7edd110be9c00cda1861854921f0f36 (patch)
tree462871a6da81c13603508449ae786b807b775f3d /contrib/ssh-copy-id
parent3ec2c116fbf387c31bd080b9b184339e2b34319d (diff)
Call restorecon on copied ~/.ssh/authorized_keys if possible, since some
SELinux policies require this (closes: #658675).
Diffstat (limited to 'contrib/ssh-copy-id')
-rw-r--r--contrib/ssh-copy-id2
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/ssh-copy-id b/contrib/ssh-copy-id
index 9451aceec..86d037abd 100644
--- a/contrib/ssh-copy-id
+++ b/contrib/ssh-copy-id
@@ -41,7 +41,7 @@ fi
41# strip any trailing colon 41# strip any trailing colon
42host=`echo $1 | sed 's/:$//'` 42host=`echo $1 | sed 's/:$//'`
43 43
44{ eval "$GET_ID" ; } | ssh $host "umask 077; test -d ~/.ssh || mkdir ~/.ssh ; cat >> ~/.ssh/authorized_keys" || exit 1 44{ eval "$GET_ID" ; } | ssh $host "umask 077; test -d ~/.ssh || mkdir ~/.ssh ; cat >> ~/.ssh/authorized_keys && (test -x /sbin/restorecon && /sbin/restorecon ~/.ssh ~/.ssh/authorized_keys >/dev/null 2>&1 || true)" || exit 1
45 45
46cat <<EOF 46cat <<EOF
47Now try logging into the machine, with "ssh '$host'", and check in: 47Now try logging into the machine, with "ssh '$host'", and check in: