ssh-copy-id: add restorecon call
In certain situations when creating an authorized_key file on a Linux machine restorecon(1) may need to be called. Therefore, attempt to run it if it exists. MFC After: 1 week Idea from: https://bugzilla.redhat.com/show_bug.cgi?id=739989
This commit is contained in:
parent
ef39d7e910
commit
0f4d097284
@ -46,6 +46,9 @@ sendkey() {
|
||||
printf "$alg $key $comment\n" >> "$keyfile" ; \
|
||||
fi ; \
|
||||
done \
|
||||
if [ -x /sbin/restorecon ]; then \
|
||||
/sbin/restorecon -F "$HOME/.ssh/" "$keyfile" >/dev/null 2>&1 || true ; \
|
||||
fi
|
||||
'\'
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user