summaryrefslogtreecommitdiff
path: root/lib/Vyatta/Login/User.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Vyatta/Login/User.pm')
-rwxr-xr-xlib/Vyatta/Login/User.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Vyatta/Login/User.pm b/lib/Vyatta/Login/User.pm
index f6706e4e..018e7e12 100755
--- a/lib/Vyatta/Login/User.pm
+++ b/lib/Vyatta/Login/User.pm
@@ -130,10 +130,11 @@ sub set_authorized_keys {
unless (-d $sshdir) {
mkdir $sshdir;
chown ($uid, $gid, $sshdir);
+ chmod (0750, $sshdir);
}
my $auth;
- unless (open (my $auth, "$sshdir/authorized_keys")) {
+ unless (open (my $auth, '>', "$sshdir/authorized_keys")) {
warn "open $sshdir/authorized_keys failed: $!";
return;
}
@@ -152,6 +153,7 @@ sub set_authorized_keys {
}
select STDOUT;
close $auth;
+ chmod (0640, "$sshdir/authorized_keys");
}
sub update {