bkctld-key: check if the key file is readable
This commit is contained in:
parent
aa8bc9381b
commit
c7816abd1e
|
@ -22,8 +22,8 @@ if [ -z "${keyfile}" ]; then
|
|||
cat "${jail_path}/${AUTHORIZED_KEYS}"
|
||||
fi
|
||||
else
|
||||
[ -e "${keyfile}" ] || error "Keyfile ${keyfile} dosen't exist !"
|
||||
test -r "${keyfile}" || error "${jail_name}: SSH key '${keyfile}' is missing or is not readable."
|
||||
cat "${keyfile}" > "${jail_path}/${AUTHORIZED_KEYS}"
|
||||
chmod 600 "${jail_path}/${AUTHORIZED_KEYS}"
|
||||
notice "${jail_name}: update key => ${keyfile}"
|
||||
notice "${jail_name}: SSH key has been updated with ${keyfile}"
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue