diff options
author | Erik Fonnesbeck <efonnes@gmail.com> | 2010-12-03 16:56:28 -0700 |
---|---|---|
committer | Erik Fonnesbeck <efonnes@gmail.com> | 2010-12-03 16:56:28 -0700 |
commit | cdab65ccce44ecda51093e3719544302c4f306a0 (patch) | |
tree | da4a0d3616e3a35d089e66b622205955b6c7d4ca /etc | |
parent | 5e86efe0bceeddc4fd434ed8fccadcd417b8ef3c (diff) | |
download | pfsense-cdab65ccce44ecda51093e3719544302c4f306a0.zip pfsense-cdab65ccce44ecda51093e3719544302c4f306a0.tar.gz |
Remove authorized_keys file when there are no authorized keys for the user.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/auth.inc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/etc/inc/auth.inc b/etc/inc/auth.inc index 43edae1..381c2e5 100644 --- a/etc/inc/auth.inc +++ b/etc/inc/auth.inc @@ -420,7 +420,8 @@ function local_user_set(& $user) { $keys = base64_decode($user['authorizedkeys']); file_put_contents("{$user_home}/.ssh/authorized_keys", $keys); chown("{$user_home}/.ssh/authorized_keys", $user_name); - } + } else + unlink_if_exists("{$user_home}/.ssh/authorized_keys"); $un = $lock_account ? "" : "un"; exec("/usr/sbin/pw {$un}lock -q {$user_name}"); |