private function dumpKeys(IHaveAnSSHKey $user) { $ssh_key_id = 0; $user_name = $user->getUserName(); foreach ($user->getAuthorizedKeysArray() as $key) { $filePath = $this->getKeyDirPath() . '/' . $user_name . '@' . $ssh_key_id . '.pub'; $this->writeKeyIfChanged($filePath, $key); $ssh_key_id++; } $this->removeUserExistingKeysFromAGivenKeyId($user_name, $ssh_key_id); }