mirror of
https://git.yoctoproject.org/poky
synced 2026-03-19 05:39:39 +01:00
openssh: Be more restrictive on private key file permissions
Sometimes default permissions on filesystems can be more permissive e.g. 0644, this can make the private key file created here to inherit those permissions and these permissions can then cause ssh server to not allow ssh connections due to non-secure permissions on file. Reported-by: Jean-Michel Papy <jean-michel.papy@exail.com> (From OE-Core rev: 5c9f456cc39ca25123249ecb32b311736bd4e1f8) Signed-off-by: Khem Raj <raj.khem@gmail.com> Cc: Jörg Sommer <joerg.sommer@navimatix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -8,7 +8,7 @@ generate_key() {
|
||||
mkdir -p "$DIR"
|
||||
rm -f ${FILE}.tmp
|
||||
ssh-keygen -q -f "${FILE}.tmp" -N '' -t $TYPE
|
||||
|
||||
chmod go-rwx "$FILE.tmp"
|
||||
# Atomically rename file public key
|
||||
mv -f "${FILE}.tmp.pub" "${FILE}.pub"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user