Config::OpenSSH::Authkey::Entry::Options - authorized_keys entry options handler
Parse an options string:
my $op = Config::OpenSSH::Authkey::Entry::Options->new('no-pty,no-user-rc'); $op->set_option('from', '127.0.0.1'); $op->unset_option('no-pty'); print $op->as_string;
This module parses option strings (no-pty,from="",...) from OpenSSH authorized_keys files. It is used by Config::OpenSSH::Authkey::Entry. Consult the AUTHORIZED_KEYS FILE FORMAT section of sshd(8) for more information about these options.
no-pty,from="",...
authorized_keys
AUTHORIZED_KEYS FILE FORMAT
Constructor. Optionally accepts an option string to parse.
Accepts a string of comma separated options, and parses these into a list of hash references. In scalar context, returns a reference to the list. In list context, returns a list.
Utility method in the event an option string was not passed to new.
Returns the value (or values) for a named option. OpenSSH does allow duplicate entries for options, though in most cases this method will only return a single value. Options are boolean or string value; boolean options return the name of the method, while string options return the string value. Assuming the options have been set as shown above:
# returns 'no-agent-forwarding' $entry->get_option('no-agent-forwarding'); # returns '127.0.0.1' $entry->get_option('from');
In scalar context, only the first option is returned (or the empty string). In list context, a list of one (or rarely more) values will be returned (or the empty list).
Returns a list of all option names that exist in the instance.
Enables an option, or with an additional argument, sets the string value for that option.
# boolean $entry->set_option('no-agent-forwarding'); # string value $entry->set_option(from => '127.0.0.1');
If multiple options with the same name are present in the options list, only the first option found will be updated, and all subsequent entries removed from the options list.
Deletes all occurrences of the named option.
Removes all options.
Returns the options as a comma separated value list. Any option values that contain a doublequote (") that is not escaped with a backslash (\) will be escaped with a backslash.
"
\
No known bugs. Newer versions of this module may be available from CPAN.
If the bug is in the latest version, send a report to the author. Patches that fix problems or add new features are welcome.
sshd(8), ssh-keygen(1), Config::OpenSSH::Authkey::Entry
Jeremy Mates, <jmates@cpan.org>
Copyright 2010 by Jeremy Mates.
This program is free software; you can redistribute it and/or modify it under the Artistic license.
To install Config::OpenSSH::Authkey, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Config::OpenSSH::Authkey
CPAN shell
perl -MCPAN -e shell install Config::OpenSSH::Authkey
For more information on module installation, please visit the detailed CPAN module installation guide.