PHPackages                             almajiro/authorized-keys - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. almajiro/authorized-keys

ActiveLibrary

almajiro/authorized-keys
========================

authorized\_keys manager

00PHPCI failing

Since Nov 30Pushed 6y ago1 watchersCompare

[ Source](https://github.com/almajiro/authorized-keys)[ Packagist](https://packagist.org/packages/almajiro/authorized-keys)[ RSS](/packages/almajiro-authorized-keys/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Authorized Keys
===============

[](#authorized-keys)

[![StyleCI](https://camo.githubusercontent.com/cdc31a2da56b25bf361658bf37ea9495247494ad344e978de3f239ed61e592ba/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3232343137333538312f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/224173581)[![Build Status](https://camo.githubusercontent.com/f0773623fa47f50ebfdc0ec23e34fdd87dd7c6ee4083eec215a2484af38b5aea/68747470733a2f2f7472617669732d63692e6f72672f616c6d616a69726f2f617574686f72697a65642d6b6579732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/almajiro/authorized-keys)[![Coverage Status](https://camo.githubusercontent.com/60468f84b2e23ea5a3ede55f51d09b40c8efa6a1675218bbcec839922f6c410b/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f616c6d616a69726f2f617574686f72697a65642d6b6579732f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/almajiro/authorized-keys?branch=master)

Manage SSH `authorized_keys`

Installation
============

[](#installation)

```
composer require almajiro/authorized-keys
```

Example
=======

[](#example)

Create New authorized\_keys
---------------------------

[](#create-new-authorized_keys)

```
use Almajiro\AuthorizedKeys\AuthorizedKeys;
use Almajiro\AuthorizedKeys\Entities\PublicKey;

$keys = new AuthorizedKeys();
$publicKey = new PublicKey('AAAAB3NzaC1yc2EAAAADAQABAAABAQDZd6ljNm...', 'ssh-rsa', [], 'admin@localhost');
$keys->add($publicKey);

$keys->save('~/.ssh/authorized_keys');

```

Read from authorized\_keys
--------------------------

[](#read-from-authorized_keys)

```
use Almajiro\AuthorizedKeys\AuthorizedKeys;

$keys = AuthorizedKeys::open('~/.ssh/authorized_keys');
var_dump($keys);

object(Almajiro\AuthorizedKeys\AuthorizedKeys)#1 (1) {
  ["keys":"Almajiro\AuthorizedKeys\AuthorizedKeys":private]=>
  array(3) {
    [0]=>
    object(Almajiro\AuthorizedKeys\Entities\PublicKey)#2 (4) {
      ["key":"Almajiro\AuthorizedKeys\Entities\PublicKey":private]=>
      string(372) "AAAAB3NzaC1yc2EAAAADAQABAAABAQDZd6ljNm..."
      ["type":"Almajiro\AuthorizedKeys\Entities\PublicKey":private]=>
      string(7) "ssh-rsa"
      ["options":"Almajiro\AuthorizedKeys\Entities\PublicKey":private]=>
      array(2) {
        [0]=>
        object(Almajiro\AuthorizedKeys\Entities\Options\Command)#4 (1) {
          ["command":"Almajiro\AuthorizedKeys\Entities\Options\Command":private]=>
          string(16) "ls"
        }
        [1]=>
        object(Almajiro\AuthorizedKeys\Entities\Options\NoAgentForwarding)#5 (0) {
        }
      }
      ["comment":"Almajiro\AuthorizedKeys\Entities\PublicKey":private]=>
      string(17) "admin@localhost"
    }
    [1]=>
    object(Almajiro\AuthorizedKeys\Entities\PublicKey)#6 (4) {
      ["key":"Almajiro\AuthorizedKeys\Entities\PublicKey":private]=>
      string(372) "AAAAB3NzaC1yc2EAAAADAQABAAABAQDZd6ljNm..."
      ["type":"Almajiro\AuthorizedKeys\Entities\PublicKey":private]=>
      string(7) "ssh-rsa"
      ["options":"Almajiro\AuthorizedKeys\Entities\PublicKey":private]=>
      array(0) {
      }
      ["comment":"Almajiro\AuthorizedKeys\Entities\PublicKey":private]=>
      string(0) ""
    }

```

Add Public-Key with some options
--------------------------------

[](#add-public-key-with-some-options)

```
use Almajiro\AuthorizedKeys\Entities\PublicKey;
use Almajiro\AuthorizedKeys\Entities\Options\NoX11Forwarding;

$publicKey = new PublicKey(
	'AAAAB3NzaC1yc2EAAAADAQABAAABAQDZd6ljNm...',
	'ssh-rsa',
	[
		new NoX11Forwarding()
	],
	'admin@localhost'
);

$keys->add($publicKey);

```

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7089652?v=4)[Kuroki Almajiro](/maintainers/almajiro)[@almajiro](https://github.com/almajiro)

---

Top Contributors

[![almajiro](https://avatars.githubusercontent.com/u/7089652?v=4)](https://github.com/almajiro "almajiro (34 commits)")

### Embed Badge

![Health badge](/badges/almajiro-authorized-keys/health.svg)

```
[![Health](https://phpackages.com/badges/almajiro-authorized-keys/health.svg)](https://phpackages.com/packages/almajiro-authorized-keys)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
