Config-Model-OpenSsh-2.8.0.1/0000755000175000017500000000000013535205025014142 5ustar domidomiConfig-Model-OpenSsh-2.8.0.1/MANIFEST0000644000175000017500000000451713535205025015302 0ustar domidomi# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.012. Build.PL Changes LICENSE MANIFEST MANIFEST.SKIP META.json META.yml README-build-from-git.md README.pod contrib/README.org contrib/fixup-element-ipqos.yml contrib/lib/ParseMan.pm contrib/parse-man.pl contrib/ssh-fixup.yaml contrib/ssh-portforward.yml contrib/sshd-fixup.yaml contrib/sshd-matchblock.yml contrib/sshd-matchcondition.yml contrib/systemssh.yml lib/Config/Model/Backend/OpenSsh/Role/MatchBlock.pm lib/Config/Model/Backend/OpenSsh/Role/Reader.pm lib/Config/Model/Backend/OpenSsh/Role/Writer.pm lib/Config/Model/Backend/OpenSsh/Ssh.pm lib/Config/Model/Backend/OpenSsh/Sshd.pm lib/Config/Model/OpenSsh.pm lib/Config/Model/models/Ssh.pl lib/Config/Model/models/Ssh.pod lib/Config/Model/models/Ssh/HostElement.pl lib/Config/Model/models/Ssh/HostElement.pod lib/Config/Model/models/Ssh/PortForward.pl lib/Config/Model/models/Ssh/PortForward.pod lib/Config/Model/models/Sshd.pl lib/Config/Model/models/Sshd.pod lib/Config/Model/models/Sshd/MatchBlock.pl lib/Config/Model/models/Sshd/MatchBlock.pod lib/Config/Model/models/Sshd/MatchCondition.pl lib/Config/Model/models/Sshd/MatchCondition.pod lib/Config/Model/models/Sshd/MatchElement.pl lib/Config/Model/models/Sshd/MatchElement.pod lib/Config/Model/models/SystemSsh.pl lib/Config/Model/models/SystemSsh.pod lib/Config/Model/system.d/sshd lib/Config/Model/system.d/system-ssh lib/Config/Model/user.d/ssh t/README.md t/author-critic.t t/custom_sshd.t t/custom_sshd_match.t t/model_tests.d/ssh-examples/bad-forward/system_ssh_config t/model_tests.d/ssh-examples/bad-forward/user_ssh_config t/model_tests.d/ssh-examples/bad-pref-auth/system_ssh_config t/model_tests.d/ssh-examples/bad-pref-auth/user_ssh_config t/model_tests.d/ssh-examples/basic/system_ssh_config t/model_tests.d/ssh-examples/basic/user_ssh_config t/model_tests.d/ssh-examples/legacy/system_ssh_config t/model_tests.d/ssh-examples/legacy/user_ssh_config t/model_tests.d/ssh-test-conf.pl t/model_tests.d/sshd-examples/bad-password-authentication/system_sshd_config t/model_tests.d/sshd-examples/debian-bug-671367/system_sshd_config t/model_tests.d/sshd-test-conf.pl t/model_tests.d/system-ssh-examples/basic/system_ssh_config t/model_tests.d/system-ssh-test-conf.pl t/model_tests.t t/pod.t t/ssh_config.t weaver.ini xt/parser.t xt/ssh_config.html xt/sshd_config.html xt/sshd_parser.t Config-Model-OpenSsh-2.8.0.1/LICENSE0000644000175000017500000006013213535205025015151 0ustar domidomiThis software is Copyright (c) 2008-2019 by Dominique Dumont. This is free software, licensed under: The GNU Lesser General Public License, Version 2.1, February 1999 The GNU Lesser General Public License (LGPL) Version 2.1, February 1999 (The master copy of this license lives on the GNU website.) Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Config-Model-OpenSsh-2.8.0.1/t/0000755000175000017500000000000013535205025014405 5ustar domidomiConfig-Model-OpenSsh-2.8.0.1/t/README.md0000644000175000017500000000176513535205025015675 0ustar domidomi## Running the tests All tests can be run in parrallel with prove -j8 t/ ### Test options Most tests can be run with the options provided by [Config::Model::Tester::Setup](https://metacpan.org/pod/Config::Model::Tester::Setup): * `-trace`: show more information * `-error`: show stack stace in case of error * `-log`: Enable logs (you may need to tweak `~/.log4config-model` to get more trace. See [cme/Logging](https://metacpan.org/pod/distribution/App-Cme/bin/cme#Logging) for more details. ### model_tests.t This test is set of subtests made of test cases. It accepts arguments to limit the test to one subtest and one test case: perl t/model_test.t [ --log ] [--error] [--trace] [ subtest [ test_case ] ] See [Config::Model::Tester](https://metacpan.org/pod/Config::Model::Tester) for more details. ### Running with prove You can run all tests with prove -j8 t/ To run with local files: prove -l -j8 t/ You can pass parameter to test files with: prove -l t/ :: --log Config-Model-OpenSsh-2.8.0.1/t/pod.t0000644000175000017500000000014513535205025015354 0ustar domidomi# -*- cperl -*- use strict; use warnings; use Test::More; use Test::Pod 1.00; all_pod_files_ok( ); Config-Model-OpenSsh-2.8.0.1/t/model_tests.d/0000755000175000017500000000000013535205025017151 5ustar domidomiConfig-Model-OpenSsh-2.8.0.1/t/model_tests.d/system-ssh-examples/0000755000175000017500000000000013535205025023104 5ustar domidomiConfig-Model-OpenSsh-2.8.0.1/t/model_tests.d/system-ssh-examples/basic/0000755000175000017500000000000013535205025024165 5ustar domidomiConfig-Model-OpenSsh-2.8.0.1/t/model_tests.d/system-ssh-examples/basic/system_ssh_config0000644000175000017500000000204413535205025027636 0ustar domidomi # This is the ssh client system-wide configuration file. See # ssh_config(5) for more information. This file provides defaults for # users, and the values can be changed in per-user configuration files # or on the command line. # Configuration data is parsed as follows: # 1. command line options # 2. user-specific file # 3. system-wide file # Any configuration value is only changed the first time it is set. # Thus, host-specific definitions should be at the beginning of the # configuration file, and defaults at the end. # Site-wide defaults for some commonly used options. For a comprehensive # list of available options, their meanings and defaults, please see the # ssh_config(5) man page. Host * IdentityFile ~/.ssh/identity IdentityFile ~/.ssh/id_rsa IdentityFile ~/.ssh/id_dsa Port 22 Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc ProxyCommand ssh -q -W %h:%p gateway.example.com SendEnv LANG LC_* HashKnownHosts yes GSSAPIAuthentication yes GSSAPIDelegateCredentials no Config-Model-OpenSsh-2.8.0.1/t/model_tests.d/system-ssh-test-conf.pl0000644000175000017500000000210713535205025023525 0ustar domidomi# # This file is part of Config-Model-OpenSsh # # This software is Copyright (c) 2008-2019 by Dominique Dumont. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # use strict; use warnings; # test loading layered config à la ssh_config my @tests = ( { # t0 name => 'basic', setup => { 'system_ssh_config' => { 'darwin' => '/etc/ssh_config', 'default' => '/etc/ssh/ssh_config', }, }, check => { 'Host:"*" Ciphers' => 'aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc', 'Host:"*" IdentityFile:1' => '~/.ssh/id_rsa', #'Host:"foo\.\*,\*\.bar"' => '', # 'LocalForward:0 port' => 20022, # 'LocalForward:0 host' => 10.3.244.4, # 'LocalForward:1 ipv6' => 1, # 'LocalForward:1 port' => 22080, # 'LocalForward:1 host' => '2001:0db8:85a3:0000:0000:8a2e:0370:7334', }, } ); return { tests => \@tests, }; Config-Model-OpenSsh-2.8.0.1/t/model_tests.d/ssh-test-conf.pl0000644000175000017500000000503313535205025022204 0ustar domidomi# # This file is part of Config-Model-OpenSsh # # This software is Copyright (c) 2008-2019 by Dominique Dumont. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # use Config::Model::BackendMgr; use strict; use warnings; # test loading layered config à la ssh_config my $home_for_test = $^O eq 'darwin' ? '/Users/joe' : '/home/joe'; # Ssh backend excepts both system and user files my @setup = ( setup => { 'system_ssh_config' => { 'darwin' => '/etc/ssh_config', 'default' => '/etc/ssh/ssh_config', }, 'user_ssh_config' => "$home_for_test/.ssh/config" } ); my @tests = ( { name => 'basic', @setup, check => [ 'Host:"*" Port' => {qw/mode layered value 22/}, 'Host:"*" Port' => '1022', # user value will completely override layered values 'Host:"*" Ciphers' => { qw/mode layered value/, '3des-cbc' }, 'Host:"*" Ciphers' => { qw/mode user value/, 'aes192-cbc,aes128-cbc' }, 'Host:"*" Ciphers' => 'aes192-cbc,aes128-cbc', #'Host:"foo\.\*,\*\.bar"' => '', 'Host:picosgw LocalForward:0 port' => 20022, 'Host:picosgw LocalForward:0 host' => '10.3.244.4', 'Host:picosgw LocalForward:1 ipv6' => 'yes', 'Host:picosgw LocalForward:1 port' => 22080, 'Host:picosgw LocalForward:1 host' => '2001:0db8:85a3:0000:0000:8a2e:0370:7334', ], verify_annotation => { '' => 'ssh global comment', 'Host:"*" SendEnv' => ' PermitLocalCommand no', 'Host:"foo.*,*.bar"' => "foo bar big\ncomment", } }, { name => 'legacy', @setup, load_check => 'skip', log4perl_load_warnings => [ [ 'User', ( warn => qr/deprecated/) x 2, warn => qr/Unknown parameter/, ] ], }, { name => 'bad-forward', @setup, load_check => 'skip', load => 'Host:"foo.*,*.bar" LocalForward:0 port=20022', log4perl_load_warnings => [ [ 'User', warn => qr/value '20022\+' does not match regexp/ ] ], }, { name => 'bad-pref-auth', @setup, load_check => 'skip', log4perl_load_warnings => [ [ 'User', ( warn => qr/Unexpected authentication method/) , ] ], }, ); return { home_for_test => $home_for_test, tests => \@tests, }; Config-Model-OpenSsh-2.8.0.1/t/model_tests.d/ssh-examples/0000755000175000017500000000000013535205025021562 5ustar domidomiConfig-Model-OpenSsh-2.8.0.1/t/model_tests.d/ssh-examples/bad-forward/0000755000175000017500000000000013535205025023752 5ustar domidomiConfig-Model-OpenSsh-2.8.0.1/t/model_tests.d/ssh-examples/bad-forward/user_ssh_config0000644000175000017500000000036413535205025027060 0ustar domidomiHost foo.*,*.bar # bad value test check propagation in LocalForward or RemoteForward element LocalForward 20022+ 10.3.244.4:22 # IPv6 example LocalForward all.com/22080 2001:0db8:85a3:0000:0000:8a2e:0370:7334/80 Config-Model-OpenSsh-2.8.0.1/t/model_tests.d/ssh-examples/bad-forward/system_ssh_config0000644000175000017500000000050013535205025027416 0ustar domidomi# Site-wide defaults for some commonly used options. For a comprehensive # list of available options, their meanings and defaults, please see the # ssh_config(5) man page. Host * Port 22 Ciphers 3des-cbc SendEnv LANG LC_* HashKnownHosts yes GSSAPIAuthentication yes GSSAPIDelegateCredentials no Config-Model-OpenSsh-2.8.0.1/t/model_tests.d/ssh-examples/legacy/0000755000175000017500000000000013535205025023026 5ustar domidomiConfig-Model-OpenSsh-2.8.0.1/t/model_tests.d/ssh-examples/legacy/user_ssh_config0000644000175000017500000000011113535205025026122 0ustar domidomi# ssh global comment Host * usersh yes fallbacktorsh yes dummy yes Config-Model-OpenSsh-2.8.0.1/t/model_tests.d/ssh-examples/legacy/system_ssh_config0000644000175000017500000000050013535205025026472 0ustar domidomi# Site-wide defaults for some commonly used options. For a comprehensive # list of available options, their meanings and defaults, please see the # ssh_config(5) man page. Host * Port 22 Ciphers 3des-cbc SendEnv LANG LC_* HashKnownHosts yes GSSAPIAuthentication yes GSSAPIDelegateCredentials no Config-Model-OpenSsh-2.8.0.1/t/model_tests.d/ssh-examples/bad-pref-auth/0000755000175000017500000000000013535205025024201 5ustar domidomiConfig-Model-OpenSsh-2.8.0.1/t/model_tests.d/ssh-examples/bad-pref-auth/user_ssh_config0000644000175000017500000000017213535205025027304 0ustar domidomiHost foo # bad value test check propagation in elements of type check_list PreferredAuthentications hostbased,publickeys Config-Model-OpenSsh-2.8.0.1/t/model_tests.d/ssh-examples/bad-pref-auth/system_ssh_config0000644000175000017500000000050013535205025027645 0ustar domidomi# Site-wide defaults for some commonly used options. For a comprehensive # list of available options, their meanings and defaults, please see the # ssh_config(5) man page. Host * Port 22 Ciphers 3des-cbc SendEnv LANG LC_* HashKnownHosts yes GSSAPIAuthentication yes GSSAPIDelegateCredentials no Config-Model-OpenSsh-2.8.0.1/t/model_tests.d/ssh-examples/basic/0000755000175000017500000000000013535205025022643 5ustar domidomiConfig-Model-OpenSsh-2.8.0.1/t/model_tests.d/ssh-examples/basic/user_ssh_config0000644000175000017500000000157613535205025025757 0ustar domidomi# ssh global comment Host * # ForwardAgent no # ForwardX11 no Port 1022 # Protocol 2,1 # Cipher 3des Ciphers aes192-cbc,aes128-cbc # PermitLocalCommand no SendEnv LANG LC_* HashKnownHosts yes GSSAPIAuthentication yes GSSAPIDelegateCredentials no # foo bar big # comment Host foo.*,*.bar # for and bar have X11 ForwardX11 yes SendEnv FOO BAR Host *.gre.hp.com ForwardX11 yes User tester Host picosgw ForwardAgent yes HostName sshgw.truc.bidule IdentityFile ~/.ssh/%r LocalForward 20022 10.3.244.4:22 # IPv6 example LocalForward all.com/22080 2001:0db8:85a3:0000:0000:8a2e:0370:7334/80 User k0013 Host picos ForwardX11 yes HostName localhost Port 20022 User ocad ControlPersist YES Config-Model-OpenSsh-2.8.0.1/t/model_tests.d/ssh-examples/basic/system_ssh_config0000644000175000017500000000050013535205025026307 0ustar domidomi# Site-wide defaults for some commonly used options. For a comprehensive # list of available options, their meanings and defaults, please see the # ssh_config(5) man page. Host * Port 22 Ciphers 3des-cbc SendEnv LANG LC_* HashKnownHosts yes GSSAPIAuthentication yes GSSAPIDelegateCredentials no Config-Model-OpenSsh-2.8.0.1/t/model_tests.d/sshd-test-conf.pl0000644000175000017500000000232013535205025022344 0ustar domidomi# # This file is part of Config-Model-OpenSsh # # This software is Copyright (c) 2008-2019 by Dominique Dumont. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # use strict; use warnings; my $map = { 'darwin' => '/etc/sshd_config', 'default' => '/etc/ssh/sshd_config', } ; my $target = $map->{$^O} || $map->{default} ; my @tests = ( { name => 'debian-bug-671367' , setup => { 'system_sshd_config' => $map, }, check => { 'AuthorizedKeysFile:0' => '/etc/ssh/userkeys/%u', 'AuthorizedKeysFile:1' => '/var/lib/misc/userkeys2/%u', }, file_contents_like => { $target , qr!/etc/ssh/userkeys/%u /var/lib/misc/userkeys2/%u! , } }, { # test that check value is indeed passed when loading Match block # that contain a bad value. The bad value is skipped. name => 'bad-password-authentication', setup => { 'system_sshd_config' => $map, }, load_check => 'skip', check => { 'Match:0 Settings PermitRootLogin' => 'no', } } ); return { tests => \@tests, }; Config-Model-OpenSsh-2.8.0.1/t/model_tests.d/sshd-examples/0000755000175000017500000000000013535205025021726 5ustar domidomiConfig-Model-OpenSsh-2.8.0.1/t/model_tests.d/sshd-examples/debian-bug-671367/0000755000175000017500000000000013535205025024476 5ustar domidomiConfig-Model-OpenSsh-2.8.0.1/t/model_tests.d/sshd-examples/debian-bug-671367/system_sshd_config0000644000175000017500000000061313535205025030313 0ustar domidomi## This file was written by Config::Model ## You may modify the content of this file. Configuration ## modifications will be preserved. Modifications in ## comments may be mangled. # Package generated configuration file # See the sshd_config(5) manpage for details # now a list AuthorizedKeysFile /etc/ssh/userkeys/%u # used to work on wheezy AuthorizedKeysFile2 /var/lib/misc/userkeys2/%u Config-Model-OpenSsh-2.8.0.1/t/model_tests.d/sshd-examples/bad-password-authentication/0000755000175000017500000000000013535205025027331 5ustar domidomi././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootConfig-Model-OpenSsh-2.8.0.1/t/model_tests.d/sshd-examples/bad-password-authentication/system_sshd_configConfig-Model-OpenSsh-2.8.0.1/t/model_tests.d/sshd-examples/bad-password-authentication/system_sshd_c0000644000175000017500000000025113535205025032121 0ustar domidomi # see also https://www.blog-libre.org/2015/11/21/loption-match-de-sshd_config/ Match Address 192.168.0.0/24,192.168.1.4 PasswordAuthentication blork PermitRootLogin noConfig-Model-OpenSsh-2.8.0.1/t/custom_sshd.t0000644000175000017500000000724513535205025017135 0ustar domidomi# -*- cperl -*- use ExtUtils::testlib; use Test::More; use Config::Model ; use Config::Model::Tester::Setup qw/init_test setup_test_dir/; use Path::Tiny; use warnings; use strict; $::_use_log4perl_to_warn = 1; my ($model, $trace) = init_test(); # pseudo root where config files are written by config-model my $wr_root = setup_test_dir; my $wr_dir1 = $wr_root->child('a'); my $ssh_subdir = $^O eq 'darwin' ? '/etc' : '/etc/ssh' ; my $ssh_path1 = $wr_dir1->child($ssh_subdir); my @orig = ; $ssh_path1->mkpath; my $ssh_file1 = $ssh_path1->child('sshd_config'); $ssh_file1->spew(@orig); my $inst = $model->instance ( root_class_name => 'Sshd', instance_name => 'sshd_instance', root_dir => $wr_dir1, backend => 'OpenSsh::Sshd', ); ok($inst,"Read $ssh_file1 and created instance") ; my $root = $inst -> config_root ; my $dump = $root->dump_tree (); print "First $wr_dir1 dump:\n",$dump if $trace ; $root -> load("Port=2222") ; my $new_dump = $root->dump_tree(); $inst->write_back() ; ok(1,"wrote data in $wr_dir1") ; # copy data in wr_dir2 my $wr_dir2 = $wr_root->child('b') ; my $ssh_dir2 = $wr_dir2->child($ssh_subdir); $ssh_dir2->mkpath; my $ssh_file2 = $ssh_dir2->child('sshd_config'); $ssh_file1->copy($ssh_dir2) ; my $inst2 = $model->instance ( root_class_name => 'Sshd', instance_name => 'sshd_instance2', root_dir => $wr_dir2, backend => 'OpenSsh::Sshd', ); ok($inst2,"Read $ssh_file2 and created instance") ; my $root2 = $inst2 -> config_root ; my $dump2 = $root2 -> dump_tree (); print "Second $wr_dir2 dump:",$dump2 if $trace ; is_deeply([split /\n/,$dump2],[split /\n/, $new_dump], "check if both dumps are consistent") ; done_testing; __DATA__ # snatched from Debian config file # Package generated configuration file # See the sshd(8) manpage for details # What ports, IPs and protocols we listen for Port 221 # Use these options to restrict which interfaces/protocols sshd will bind to #ListenAddress :: #ListenAddress 0.0.0.0 Protocol 2 # HostKeys for protocol version 2 HostKey /etc/ssh/ssh_host_rsa_key HostKey /etc/ssh/ssh_host_dsa_key #Privilege Separation is turned on for security UsePrivilegeSeparation yes # Lifetime and size of ephemeral version 1 server key KeyRegenerationInterval 3600 # Logging SyslogFacility AUTH LogLevel INFO # Authentication: LoginGraceTime 120 PermitRootLogin yes StrictModes yes RSAAuthentication yes PubkeyAuthentication yes #AuthorizedKeysFile %h/.ssh/authorized_keys # Don't read the user's ~/.rhosts and ~/.shosts files IgnoreRhosts yes # For this to work you will also need host keys in /etc/ssh_known_hosts RhostsRSAAuthentication no # similar for protocol version 2 HostbasedAuthentication no # Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication #IgnoreUserKnownHosts yes # To enable empty passwords, change to yes (NOT RECOMMENDED) PermitEmptyPasswords no # Change to yes to enable challenge-response passwords (beware issues with # some PAM modules and threads) ChallengeResponseAuthentication no # Change to no to disable tunnelled clear text passwords #PasswordAuthentication yes # Kerberos options #KerberosAuthentication no #KerberosGetAFSToken no #KerberosOrLocalPasswd yes #KerberosTicketCleanup yes # GSSAPI options #GSSAPIAuthentication no #GSSAPICleanupCredentials yes X11Forwarding yes X11DisplayOffset 10 PrintMotd no PrintLastLog yes TCPKeepAlive yes #UseLogin no MaxStartups 10:30:60 #Banner /etc/issue.net # Allow client to pass locale environment variables AcceptEnv LANG LC_* Subsystem sftp /usr/lib/openssh/sftp-server UsePAM yes AllowUsers foo bar@192.168.0.* ClientAliveCountMax 5 ClientAliveInterval 300 Config-Model-OpenSsh-2.8.0.1/t/ssh_config.t0000644000175000017500000001345413535205025016723 0ustar domidomi# -*- cperl -*- use ExtUtils::testlib; use Test::More ; use Config::Model ; use Config::Model::BackendMgr; # required for tests use Config::Model::Tester::Setup qw/init_test setup_test_dir/; use English; use Test::Differences ; use Test::Warn ; use warnings; use strict; my ($model, $trace) = init_test(); # pseudo root where config files are written by config-model my $wr_root = setup_test_dir; my $ssh_subdir = $^O eq 'darwin' ? '/etc' : '/etc/ssh' ; my $ssh_path = $wr_root->child($ssh_subdir); my @orig = ; $ssh_path->mkpath; my $ssh_file = $ssh_path->child('ssh_config'); $ssh_file->spew(@orig); # special global variable used only for tests my $joe_home = $^O eq 'darwin' ? '/Users/joe' : '/home/joe' ; ; Config::Model::BackendMgr::_set_test_home($joe_home) ; # set up Joe's environment my $joe_ssh = $wr_root->child($joe_home.'/.ssh'); $joe_ssh->mkpath; my $joe_config = $joe_ssh->child('config'); $joe_config->spew("Host mine.bar\n\nIdentityFile ~/.ssh/mine\n") ; sub read_user_ssh { my $file = shift ; my $clean = sub { my $l = shift; chomp $l; $l =~ s/\s+/ /g; return $l; }; my @res = grep {/\w/} map { $clean->($_) ;} grep { not /##/ } $file->lines ; return @res ; } print "Test from directory $wr_root\n" if $trace ; note "Running test like root (no layered config)" ; my $root_inst = $model->instance ( root_class_name => 'SystemSsh', instance_name => 'root_ssh_instance', root_dir => $wr_root, ); ok($root_inst,"Read $ssh_file and created instance") ; my $root_cfg = $root_inst -> config_root ; $root_cfg->init ; my $dump = $root_cfg->dump_tree (); print $dump if $trace ; like($dump,qr/^#"ssh global comment"/, "check global comment pattern") ; like($dump,qr/Ciphers=aes192-cbc,aes128-cbc,3des-cbc,blowfish-cbc,aes256-cbc#" Protocol 2,1\s+Cipher 3des"/,"check Ciphers comment"); like($dump,qr/SendEnv#" PermitLocalCommand no"/,"check SendEnv comment"); like($dump,qr/Host:"foo\.\*,\*\.bar"/, "check Host pattern") ; like($dump,qr/LocalForward:0\s+port=20022/, "check user LocalForward port") ; like($dump,qr/host=10.3.244.4/, "check user LocalForward host") ; like($dump,qr/LocalForward:1#"IPv6 example"\s+ipv6=yes/, "check user LocalForward ipv6") ; like($dump,qr/port=22080/, "check user LocalForward port ipv6") ; like($dump,qr/host=2001:0db8:85a3:0000:0000:8a2e:0370:7334/, "check user LocalForward host ipv6") ; $root_inst->write_back() ; ok(1,"wrote ssh_config data in $wr_root") ; my $inst2 = $model->instance ( root_class_name => 'SystemSsh', instance_name => 'root_ssh_instance2', root_dir => $wr_root, ); my $root2 = $inst2 -> config_root ; my $dump2 = $root2 -> dump_tree (); print $dump2 if $trace ; is_deeply([split /\n/,$dump2],[split /\n/,$dump], "check if both root_ssh dumps are identical") ; SKIP: { skip "user tests when test is run as root", 12 if $EUID == 0 ; note "Running test like user with layered config"; my $user_inst = $model->instance ( root_class_name => 'Ssh', instance_name => 'user_ssh_instance', root_dir => $wr_root, ); ok($user_inst,"Read user .ssh/config and created instance") ; my @joe_orig = read_user_ssh($joe_config) ; my $user_cfg = $user_inst -> config_root ; $dump = $user_cfg->dump_tree (mode => 'full' ); print $dump if $trace ; like($dump,qr/Host:"foo\.\*,\*\.bar"/,"check root Host pattern") ; like($dump,qr/Host:"?mine.bar"?/,"check user Host pattern") ; $user_inst->write_back() ; ok(1,"wrote user .ssh/config data in $joe_config") ; ok($joe_config->is_file,"Found $joe_config") ; # compare original and written file my @joe_written = read_user_ssh($joe_config) ; eq_or_diff(\@joe_written,\@joe_orig,"check user .ssh/config files") ; # write some data $user_cfg->load('EnableSSHKeysign=1') ; $user_inst->write_back() ; unshift @joe_orig,'EnableSSHKeysign yes'; @joe_written = read_user_ssh($joe_config) ; eq_or_diff(\@joe_written,\@joe_orig,"check user .ssh/config files after modif") ; # run test on tricky element warning_like { $user_inst->load( check => 'skip', step => 'Host:"*" IPQoS="foo bar baz"') ; } qr/skipping value/ ,"too many fields warning"; warning_like { $user_inst->load( check => 'skip', step => 'Host:"*" IPQoS="foo"') ; } qr/skipping/ ,"bad fields warning"; ok($user_inst->has_error,"check errors count") ; like($user_inst->error_messages,qr/"af11"/,"check error message") ; $user_inst->load('Host:"*" IPQoS="af11 af12"') ; # fix is pending my $expect = $Config::Model::VERSION > 2.046 ? 0 : 1 ; is($user_inst->has_error,$expect,"check error count after fix") ; # check if config has warnings is($user_inst->has_warning,0,"check if warnings are left"); } done_testing; __END__ # ssh global comment Host * # ForwardAgent no # ForwardX11 no Port 1022 # Protocol 2,1 # Cipher 3des Ciphers aes192-cbc,aes128-cbc,3des-cbc,blowfish-cbc,aes256-cbc # PermitLocalCommand no SendEnv LANG LC_* HashKnownHosts yes GSSAPIAuthentication yes GSSAPIDelegateCredentials no # foo bar big # comment Host foo.*,*.bar # for and bar have X11 ForwardX11 yes SendEnv FOO BAR Host *.gre.hp.com ForwardX11 yes User tester Host picosgw ForwardAgent yes HostName sshgw.truc.bidule IdentityFile ~/.ssh/%r LocalForward 20022 10.3.244.4:22 # IPv6 example LocalForward all.com/22080 2001:0db8:85a3:0000:0000:8a2e:0370:7334/80 User k0013 Host picos ForwardX11 yes HostName localhost Port 20022 User ocad ControlPersist YES Config-Model-OpenSsh-2.8.0.1/t/author-critic.t0000644000175000017500000000075013535205025017351 0ustar domidomi#!perl # # This file is part of Config-Model-OpenSsh # # This software is Copyright (c) 2008-2019 by Dominique Dumont. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # BEGIN { unless ($ENV{AUTHOR_TESTING}) { print qq{1..0 # SKIP these tests are for testing by the author\n}; exit } } use strict; use warnings; use Test::Perl::Critic (-profile => "perlcritic.rc") x!! -e "perlcritic.rc"; all_critic_ok(); Config-Model-OpenSsh-2.8.0.1/t/model_tests.t0000644000175000017500000000022213535205025017110 0ustar domidomi# -*- cperl -*- use warnings; use strict; use Config::Model::Tester 4.001; use ExtUtils::testlib; $::_use_log4perl_to_warn = 1; run_tests() ; Config-Model-OpenSsh-2.8.0.1/t/custom_sshd_match.t0000644000175000017500000000463013535205025020304 0ustar domidomi# -*- cperl -*- use ExtUtils::testlib; use Test::More; use Test::Differences; use Config::Model ; use Config::Model::Tester::Setup qw/init_test setup_test_dir/; use Path::Tiny; use warnings; use strict; $::_use_log4perl_to_warn = 1; my ($model, $trace) = init_test(); # pseudo root where config files are written by config-model my $wr_root = setup_test_dir; my $wr_dir1 = $wr_root->child('a'); my $ssh_subdir = $^O eq 'darwin' ? '/etc' : '/etc/ssh' ; my $ssh_path1 = $wr_dir1->child($ssh_subdir); my @orig = ; $ssh_path1->mkpath; my $ssh_file1 = $ssh_path1->child('sshd_config'); $ssh_file1->spew(@orig); my $inst = $model->instance ( root_class_name => 'Sshd', instance_name => 'sshd_instance', root_dir => $wr_dir1, backend => 'OpenSsh::Sshd', ); ok($inst,"Read $ssh_file1 and created instance") ; my $root = $inst -> config_root ; my $dump = $root->dump_tree (); print "First $wr_dir1 dump after reading file:\n",$dump if $trace ; #like($dump,qr/Match:0/, "check Match section") if $testdir =~ /match/; $root -> load("Port=2222 HostbasedAuthentication=yes" . " Subsystem:ddftp=/home/dd/bin/ddftp Match:1 Condition Host=elysee.* ") ; my $mod_dump = $root->dump_tree (); print "First $wr_dir1 dump after modification:\n",$dump if $trace ; $inst->write_back() ; ok(1,"wrote data in $wr_dir1") ; # copy data in wr_dir2 my $wr_dir2 = $wr_root->child('b') ; my $ssh_dir2 = $wr_dir2->child($ssh_subdir); $ssh_dir2->mkpath; my $ssh_file2 = $ssh_dir2->child('sshd_config'); $ssh_file1->copy($ssh_dir2) ; my $inst2 = $model->instance ( root_class_name => 'Sshd', instance_name => 'sshd_instance2', root_dir => $wr_dir2, backend => 'OpenSsh::Sshd', ); ok($inst2,"Read $ssh_file2 and created instance") ; my $root2 = $inst2 -> config_root ; my $dump2 = $root2 -> dump_tree (); print "Second $wr_dir2 dump:\n",$dump2 if $trace ; eq_or_diff([split /\n/,$dump2], [split /\n/,$mod_dump], "check if both dumps are consistent") ; done_testing; __DATA__ X11Forwarding yes Match User domi AllowTcpForwarding yes PasswordAuthentication yes RhostsRSAAuthentication no RSAAuthentication yes X11DisplayOffset 10 X11Forwarding yes # sarkomment Match User sarko Group pres.* Banner /etc/bienvenue.txt X11Forwarding no # some comment Match User bush Group pres.* Host white.house.* Banner /etc/welcome.txt Config-Model-OpenSsh-2.8.0.1/weaver.ini0000644000175000017500000000022513535205025016133 0ustar domidomi[@Default] [-Transformer] transformer = List [Support] perldoc = 0 bugs = metadata websites = search,anno,ratings,kwalitee,testers,testmatrix,deps Config-Model-OpenSsh-2.8.0.1/README-build-from-git.md0000644000175000017500000000372413535205025020246 0ustar domidomi# How to build Config::Model::OpenSsh from git repository `Config::Model::OpenSsh` is build with [Dist::Zilla](http://dzil.org/). This page details how to install the tools and dependencies required to build this module. ## Install tools and dependencies ### Debian, Ubuntu and derivatives Run $ sudo apt install libdist-zilla-perl libdist-zilla-app-command-authordebs-perl $ dzil authordebs --install $ sudo apt build-dep libconfig-model-openssh-perl The [libdist-zilla-app-command-authordebs-perl package](https://tracker.debian.org/pkg/libdist-zilla-app-command-authordebs-perl) is quite recent (uploaded on Dec 2016 in Debian/unstable) and may not be available yet on your favorite distribution. ### Other systems Run $ cpamn Dist::Zilla $ dzil authordeps -missing | cpanm --notest $ dzil listdeps --missing | cpanm --notest NB: The author would welcome pull requests that explains how to install these tools and dependencies using native package of other distributions. ## Build Config::Model::OpenSsh Run dzil build or dzil test `dzil` may complain about missing `EmailNotify` or `Twitter` plugin. You may ignore this or edit [dist.ini](dist.ini) to comment out the last 2 sections. These are useful only to the author when releasing a new version. `dzil` may also return an error like `Cannot determine local time zone`. In this case, you should specify explicitely your timezone in a `TZ` environement variable. E.g run `dzil` this way: TZ="Europe/Paris" dzil test The list of possible timezones is provided by [DateTime::TimeZone::Catalog](https://metacpan.org/pod/DateTime::TimeZone::Catalog) documentation. ## Model generation Ssh model can be regenerated from ssh man pages with the following steps: * make sure that `ssh_config` and `sshd_config` man pages are available * Run `perl contrib/parse-man.pl` * Inspect the result * Then build the module as shown above For more details, see this [readme file](contrib/README.org) Config-Model-OpenSsh-2.8.0.1/Changes0000644000175000017500000003332513535205025015443 0ustar domidomi2.8.0.1 2019-09-08 Update: * Support for OpenSsh 8.0 Bug fix related to generation of OpenSsh model: * fix storage of description text * change quoted text to text with bold font * replace utf-8 quote with ascii quote 2.7.9.2 2019-06-14 This release fixes CI/CD bugs: * Work around Dzil bug that break tests on travis. * Fix statement in test not compatible with perl 5.12 2.7.9.1 2019-06-10 The main visible changes of this release are: * Support for OpenSsh 7.9 * A new version number scheme: v... Under the hood, the major change of this release is the way Ssh and Sshd model are updated. It used to be a manual work (which explain why only OpenSsh 6.4 parameters were supported). Now the model is generated from ssh_config and sshd_config manuel pages. All parameters from OpenSsh 7.9 are supported and obsolete parameters are silently dropped or migrated to new parameters. Other changes: * update test specifications (requires Config::Model::Tester 4.001) * require Config::Model 2.134 1.241 2018-12-01 * Tests require Config::Model 2.128 (gh #4) 1.240 2018-11-30 Fix behavior of 'cme -force' so user can load ssh config files containing errors: * allow force load when Match block contain bad data * propagate 'check' when setting check_list parameter (require Config::Model 2.127) Model update: * PortForward parameter: port must be alphanumeric 1.239 2018-05-08 * OpenSsh backend: fix backend (broke with Config::Model 2.123, requires Config::Model 2.123. Sorry about the mess). * added t/README.md * remove deprecated suffix method 1.238 2017-10-08 * udpated models to use new rw_config parameter (requires Config::Model 2.111) * update Ciphers parameter * UseLogin parameter is deprecated 1.237 2016-03-07 * Fix tests broken by Config::Model 2.080 changes (RT #112736) * Build.PL: avoid dependency on cme to build doc * dist.ini: * updated to use github's bug tracker - removed build dependency on Tk * updated README.pod to use cme meta edit 1.236 2014-05-22 * removed experience parameters from OpenSsh model with config-model-edit * removed build time dependency on AnyEvent * warn and propose a fix when public key is used as IdendityFile 1.235 2014-04-04 * tweak test to be compatible with Config::Model >= or < 2.052 * fix man pages abstract section (for Pod::Weaver) 1.234 2014-03-01 * fixed skipped test count in ssh_config.t to enable cpanm installation (RT 93314) * test $inst->has_warning (requires Config::Model 2.050) 1.233 2014-02-13 * Ssh backends: send a clear error message when unknown parameters are found (RT 92639) * Ssh: added deprecated UseRSh and FallBackToRsh (RT 92639) 1.232 2013-12-29 * Ssh::GSSAPI* params: set upstream_default to 0 (instead of default) * fixed typo in Sshd::MatchCondition description (tx gregoa) 1.231 2013-12-23 * Added parameters supported by OpenSsh 6.4 (i.e. IgnoreUnknown ForwardX11Timeout GatewayPorts GSSAPIKeyExchange GSSAPIClientIdentity GSSAPIServerIdentity GSSAPIDelegateCredentials GSSAPIRenewalForcesRekey GSSAPITrustDns IPQoS KexAlgorithms PKCS11Provider AllowAgentForwarding AuthenticationMethods AuthorizedKeysCommand AuthorizedKeysCommandUser AuthorizedPrincipalsFile ChrootDirectory GSSAPIStoreCredentialsOnRekey HostCertificate HostKeyAgent MaxSessions PermitBlacklistedKeys PubkeyAuthentication RekeyLimit RevokedKeys RhostsRSAAuthentication TrustedUserCAKeys VersionAddendum) 1.230 2013-08-27 This new release now works on MacOS X. It does take into account the different location of ssh configuration files compared to Linux or BSD. * Fixed tests for MacOS X 1.230_04 2013-08-19 * Depends on Config::Model 2.041 * Build depends on Config::Model::Tester 2.042 1.230_03 2013-08-09 * Load EV at beginning of test to avoid failure in CPAN smoke tests. 1.230_02 2013-08-08 * Load AnyEvent at beginning of test to avoid failure in CPAN smoke tests. 1.230_01 2013-08-07 * Fixed dist.ini to tweak $VERSION in all module files 1.229 2013-07-23 * fixed dist::zilla files to include .ssh dir needed for tests 1.228 2013-07-21 [ Usage changes ] * 'cme edit ssh|sshd|system-ssh' is now working on MacOS X * '/etc/ssh/ssh_config' is now handled by system-ssh. I.e. use 'cme edit system-ssh' to change this file * root user can edit its ~/.ssh/config file like any other user with 'cme edit ssh'. [ Bug fixes ] * corrected OpenSSH project name (was OpenSsh) * ssh backend: fix bug that prevented reading user file with global parameters * Ssh model: allow config file creation [ Other changes ] * renamed ChangeLog in Changes * Ssh model: use new default layer from C::M 2.040 to read system config file (hence the updated requirement on Config::Model 2.040) * All backends: removed custom code to open file. Lets Config::Model::BackendMgr handle this 2013-04-04 - 1.227 * Removed Augeas backend (no longer needed, comments are handled by Config::Model::Backend::OpenSsh) * Removed unused deps (File::Slurp) * Replaced Any::Moose with Mouse. Directly depend on Mouse. Removed dependency on Any::Mooose 2012-12-07 - 1.226 * ssh model: + added ControlPersist parameter + added Re-Build parameter (fix RT #81346) * Changed experience of Control* parameters to beginner * backend: ensure clear error message if Host is used in sshd_config * updated demos to use cme * use cme gen-class-pod to re-build when necessary * updated Config::Model dependency to 2.026 for this 2012-10-28 Dominique Dumont v 1.225 Doc and demo fix release * updated demos to use cme instead of deprecated config-edit * likewise, clean up pod doc to use cme command * removed non utf-8 char from ssh doc (Fix RT 79077) 2012-05-22 Dominique Dumont v 1.224 * Backend: make sure that AuthorizedKeysFile items are written on a single line. * Depends on Config::Model 2.017 (which has a correct dependency list). * Note to distro packagers: this dependency on Config::Model 2.017 is required for people installing this module with cpanm and for Perl smoke tests. From a feature point of view, this module requires only Config::Model 2.015 2012-05-18 Dominique Dumont v 1.223 * Added build-dependencies required by t/model_test.t (which use Config::Model::Tester) * Fix sshd-test-conf.pl to avoid test failure due to Text::Balanced warnings with perl 5.15 2012-05-16 Dominique Dumont v 1.222 * added AuthorizedKeysFile2 parameter (See Debian #671367) and migration from AuthorizedKeysFile2 to AuthorizedKeysFile to help migration from Debian Squeeze to Wheezy * replaced deprecated get_all_indexes with fetch_all_indexes * depends on Config::Model 2.015 2012-04-25 Dominique Dumont v 1.221 * Ssh model: ControlMaster also supports auto keyword (tx to harleypig and Daniel Dehennin) Closes Debian #670319 * Test: Fix skip count when test is run as root (fix smoke test failures) 2012-02-20 Dominique Dumont v 1.220 * Fix test to force write back even if no data were changed in the test (Fix FTBS Debian #660371 and Ubuntu #935221) * This fix depends on Config::Model 2.004 * Requires perl 5.10 * Move runtime dependencies in configure-requires as config::model is called by Build.PL to (re)generate pod (see also RT73611) 2011-12-07 Dominique Dumont v 1.219 * Ssh model: do not warp LocalForward with GatewayPorts. They are independant * Ssh backend: store root config in layered data instead of preset data (also fix RT#72916) * Depends on Config::Model 1.265 2011-07-22 Dominique Dumont v 1.218 * OpenSsh backend: Fix bug that tried to open a file in /etc when saving ssh config as a regular user. 2011-05-11 Dominique Dumont v 1.217 * All Backend: test value with length instead of defined (avoid keyword without value lines) * added Test::Difference build dependency * lib/Config/Model/user.d/ssh: added forgotten user file for ssh 2011-04-11 Dominique Dumont v 1.216 * All: use Any::Moose instead of plain Moose * depends on Any::Moose (fix RT# 67307) 2011-04-04 Dominique Dumont v 1.215 * All models: Added author, license and class_description * Added generated documentation from configuration classes. * Requires Config::Model 1.236 2011-03-03 Dominique Dumont v 1.214 * Fixed Build.PL to install files from lib/.../system.d/ * Fixed Ssh backend to write Host pattern annotations/comments 2011-02-28 Dominique Dumont v 1.213 * Fixed MANIFEST.SKIP to remove cruft shipped by Dist::Zilla. As downstream packager, I was not amused :/ 2011-02-23 Dominique Dumont v 1.212 * Fixed Build.PL to include prereqs computed by Dist::Zilla 2011-02-21 Dominique Dumont v 1.211 * *.t: fixed tests (Fix Debian bug #605792) * demo: split user and maintainer demo * removed config-edit-*. config-edit now has auto-completion and can be invoked with '-application ssh' or '-application sshd' * removed dependency on Parse::RecDescent * depend on Config::Model 1.234 * Single backend was split in 3 (OpenSsh, Ssh and Sshd) to benefit from C::M::Backend::Any 2010-02-02 Dominique Dumont * demo/demo.pl (my_system): new demo (requires Config::Model::Itself) 2010-01-24 Dominique Dumont * lib/Config/Model/models/Ssh/PortForward.pl: host and hostport are mandatory 2010-01-22 Dominique Dumont v1.210 * lib/Config/Model/OpenSsh.pm: Modified to read and write Port forward information from PortForward config class. * lib/Config/Model/models/Ssh/PortForward.pl: New configuration class to make ssh port forwarding configuration easier. 2010-01-18 Dominique Dumont v1.209 * lib/Config/Model/models/Sshd.pl: Added automatic migration of data from deprecated KeepAlive parameter to TCPKeepAlive parameter. This enables an automatic migration from old sshd config to new syntax. * lib/Config/Model/models/Ssh/HostElement.pl: Since ssh_config doc mentions that LocalForward and RemoteForward can be specified several times, these 2 parameters are changed from leaf to a list of leaf. * lib/Config/Model/models/Ssh.pl: As specifying Host block as list of patterns and content was not practical, the Host element in Ssh model was changed from list of HostBlock nodes to hash of HostElement. The Host patterns is used as the key of the hash. This enables a better view of shh configuration in the GUI. * lib/Config/Model/OpenSsh.pm (assign): Store value in uniline leaf even with embedded white spaces. (write_all_host_block): adapted to Host structure change in model 2009-09-10 Dominique Dumont v1.208 * lib/Config/Model/models/**.pl: Changed 'level' of some elements to 'important' so the new wizard provided by C::M::TkUI will show the most imporant ssh and sshd configuration parameters. 2009-07-29 Dominique Dumont v1.207 * t/ssh_config.t: When run as root, skip the tests that must be run as regular user. (Fix Debian FTBS) * lib/Config/Model/models/Ssh/HostElement.pl: Fix model error: ServerAliveInterval is an integer, not a boolean 2009-06-24 Dominique Dumont v1.206 * Build.PL: added forgotten dependency on Parse::RecDescent. Depends on Config::Model 0.637 2009-06-23 Dominique Dumont * lib/Config/Model/models/**.pl: replaced deprecated 'built_in' model parameter with 'upstream_default'. (In fact I just had to run "config-model-edit -model Ssh -save" (from Config::Model::Itself)) 2009-04-11 Dominique Dumont v1.205 * lib/Config/Model/OpenSsh.pm (read_ssh_file): fix bug that breaks with Config::Model 0.635 2009-03-09 Dominique Dumont v1.204 * t/ssh_config.t: Removed unused options that broke with Config::Model 0.634 * config-edit-ssh: Update documentation 2009-02-03 Dominique Dumont v1.203 * t/augeas_*.t: Do the exec only if Augeas part can be tested. Use $^X in exec instead of 'perl'. This should also fix tests in CPAN. 2009-02-02 Dominique Dumont v1.202 * t/augeas*.t : Changed Augeas locale workaround to reduce the number of test failures in CPAN tests. 2009-01-29 Dominique Dumont v1.201 * config-edit-sshd: added workaround Augeas locale bug * Sshd files: Major bug fixes for Augeas integration * lib/Config/Model/OpenSsh.pm (read_ssh_file): Fix: Host names are separated by white spaces and not comma 2008-11-16 Domi * lib/Config/Model/models/Sshd.pl: Added write through Augeas so comment in /etc/ssh/sshd_config can be preserved (requires Augeas and Config::Model::Backend::Augeas) * config-edit-ssh: new command line to edit ~/.ssh/config file (as normal user) or /etc/ssh/ssh_config (as root) 2008-05-26 Dominique Dumont v0.104 * all: changed module name from Sshd to OpenSsh 2008-05-24 Dominique Dumont v0.103 * lib/Config/Model/Sshd.pm (): Added doc * config-edit-sshd: new file Config-Model-OpenSsh-2.8.0.1/lib/0000755000175000017500000000000013535205025014710 5ustar domidomiConfig-Model-OpenSsh-2.8.0.1/lib/Config/0000755000175000017500000000000013535205025016115 5ustar domidomiConfig-Model-OpenSsh-2.8.0.1/lib/Config/Model/0000755000175000017500000000000013535205025017155 5ustar domidomiConfig-Model-OpenSsh-2.8.0.1/lib/Config/Model/system.d/0000755000175000017500000000000013535205025020723 5ustar domidomiConfig-Model-OpenSsh-2.8.0.1/lib/Config/Model/system.d/system-ssh0000644000175000017500000000002213535205025022757 0ustar domidomimodel = SystemSsh Config-Model-OpenSsh-2.8.0.1/lib/Config/Model/system.d/sshd0000644000175000017500000000001513535205025021603 0ustar domidomimodel = Sshd Config-Model-OpenSsh-2.8.0.1/lib/Config/Model/OpenSsh.pm0000644000175000017500000001100213535205025021064 0ustar domidomi# # This file is part of Config-Model-OpenSsh # # This software is Copyright (c) 2008-2019 by Dominique Dumont. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # use strict; use warnings; package Config::Model::OpenSsh ; $Config::Model::OpenSsh::VERSION = '2.8.0.1'; use Config::Model 2.111; 1; # ABSTRACT: OpenSSH config editor __END__ =pod =encoding UTF-8 =head1 NAME Config::Model::OpenSsh - OpenSSH config editor =head1 VERSION version 2.8.0.1 =head1 SYNOPSIS =head2 invoke editor The following will launch a graphical editor (if L is installed): sudo cme edit sshd =head2 command line This command will add a C section in C<~/.ssh/config>: cme modify ssh Host:Foo ForwardX11=yes =head2 programmatic This code snippet will remove the C section added above: use Config::Model ; my $model = Config::Model -> new ( ) ; my $inst = $model->instance (root_class_name => 'Ssh'); $inst -> config_root ->load("Host~Foo") ; $inst->write_back() ; =head1 DESCRIPTION This module provides a configuration editors (and models) for the configuration files of OpenSSH. (C, F and C<~/.ssh/config>). This module can also be used to modify safely the content of these configuration files from a Perl programs. Once this module is installed, you can edit C with run (as root) : # cme edit sshd To edit F, run (as root): # cme edit ssh To edit F<~/.ssh/config>, run as a normal user: $ cme edit ssh =head1 user interfaces As mentioned in L, several user interfaces are available with C subcommand: =over =item * A graphical interface is proposed by default if L is installed. =item * A Curses interface with option C if L is installed. =item * A Shell like interface with option C. =back =head1 SEE ALSO L, L, =head1 AUTHOR Dominique Dumont =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2008-2019 by Dominique Dumont. This is free software, licensed under: The GNU Lesser General Public License, Version 2.1, February 1999 =for :stopwords cpan testmatrix url annocpan anno bugtracker rt cpants kwalitee diff irc mailto metadata placeholders metacpan =head1 SUPPORT =head2 Websites The following websites have more information about this module, and may be of help to you. As always, in addition to those websites please use your favorite search engine to discover more resources. =over 4 =item * Search CPAN The default CPAN search engine, useful to view POD in HTML format. L =item * AnnoCPAN The AnnoCPAN is a website that allows community annotations of Perl module documentation. L =item * CPAN Ratings The CPAN Ratings is a website that allows community ratings and reviews of Perl modules. L =item * CPANTS The CPANTS is a website that analyzes the Kwalitee ( code metrics ) of a distribution. L =item * CPAN Testers The CPAN Testers is a network of smoke testers who run automated tests on uploaded CPAN distributions. L =item * CPAN Testers Matrix The CPAN Testers Matrix is a website that provides a visual overview of the test results for a distribution on various Perls/platforms. L =item * CPAN Testers Dependencies The CPAN Testers Dependencies is a website that shows a chart of the test results of all dependencies for a distribution. L =back =head2 Bugs / Feature Requests Please report any bugs or feature requests by email to C, or through the web interface at L. You will be automatically notified of any progress on the request by the system. =head2 Source Code The code is open to the world, and available for you to hack on. Please feel free to browse it and play with it, or whatever. If you want to contribute patches, please send me a diff or prod me to pull from your repository :) L git clone git://github.com/dod38fr/config-model-openssh.git =cut Config-Model-OpenSsh-2.8.0.1/lib/Config/Model/user.d/0000755000175000017500000000000013535205025020355 5ustar domidomiConfig-Model-OpenSsh-2.8.0.1/lib/Config/Model/user.d/ssh0000644000175000017500000000001413535205025021070 0ustar domidomimodel = Ssh Config-Model-OpenSsh-2.8.0.1/lib/Config/Model/models/0000755000175000017500000000000013535205025020440 5ustar domidomiConfig-Model-OpenSsh-2.8.0.1/lib/Config/Model/models/SystemSsh.pl0000644000175000017500000000143013535205025022735 0ustar domidomi# # This file is part of Config-Model-OpenSsh # # This software is Copyright (c) 2008-2019 by Dominique Dumont. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # use strict; use warnings; return [ { 'author' => [ 'Dominique Dumont' ], 'class_description' => 'Configuration class used by L to edit or validate /etc/ssh/ssh_config (as root) ', 'copyright' => [ '2013 Dominique Dumont' ], 'include' => [ 'Ssh' ], 'license' => 'LGPL2', 'name' => 'SystemSsh', 'rw_config' => { 'backend' => 'OpenSsh::Ssh', 'config_dir' => '/etc/ssh', 'file' => 'ssh_config', 'os_config_dir' => { 'darwin' => '/etc' } } } ] ; Config-Model-OpenSsh-2.8.0.1/lib/Config/Model/models/Ssh.pod0000644000175000017500000015325113535205025021710 0ustar domidomi# PODNAME: Config::Model::models::Ssh # ABSTRACT: Configuration class Ssh =encoding utf8 =head1 NAME Config::Model::models::Ssh - Configuration class Ssh =head1 DESCRIPTION Configuration classes used by L This configuration class was generated from ssh_system documentation. by L =head1 Elements =head2 Host Restricts the following declarations (up to the next B or B keyword) to be only for those hosts that match one of the patterns given after the keyword. If more than one pattern is provided, they should be separated by whitespace. A single '*' as a pattern can be used to provide global defaults for all hosts. The host is usually the I argument given on the command line (see the B keyword for exceptions). A pattern entry may be negated by prefixing it with an exclamation mark ('!'). If a negated entry is matched, then the B entry is ignored, regardless of whether any other patterns on the line match. Negated matches are therefore useful to provide exceptions for wildcard matches. See I for more information on patterns. I< Optional. Type hash of node of class L . > =head2 AddKeysToAgent Specifies whether keys should be automatically added to a running L. If this option is set to B and a key is loaded from a file, the key and its passphrase are added to the agent with the default lifetime, as if by L. If this option is set to B, L will require confirmation using the SSH_ASKPASS program before adding a key (see L for details). If this option is set to B, each use of the key must be confirmed, as if the B<-c> option was specified to L. If this option is set to B, no keys are added to the agent. The argument must be B, B, B, or B (the default). I< Optional. Type enum. choice: 'yes', 'confirm', 'ask', 'no'. > =over 4 =item upstream_default value : no =back =head2 AddressFamily Specifies which address family to use when connecting. Valid arguments are B (the default), B (use IPv4 only), or B (use IPv6 only). I< Optional. Type enum. choice: 'any', 'inet', 'inet6'. > =over 4 =item upstream_default value : any =back =head2 BatchMode If set to B, passphrase/password querying will be disabled. In addition, the B option will be set to 300 seconds by default (Debian-specific). This option is useful in scripts and other batch jobs where no user is present to supply the password, and where it is desirable to detect a broken network swiftly. The argument must be B or B (the default). I< Optional. Type boolean. > =over 4 =item upstream_default value : no =back =head2 BindAddress Use the specified address on the local machine as the source address of the connection. Only useful on systems with more than one address. I< Optional. Type uniline. > =head2 BindInterface Use the address of the specified interface on the local machine as the source address of the connection. I< Optional. Type uniline. > =head2 CanonicalDomains When B is enabled, this option specifies the list of domain suffixes in which to search for the specified destination host. I< Optional. Type uniline. > =head2 CanonicalizeFallbackLocal Specifies whether to fail with an error when hostname canonicalization fails. The default, B, will attempt to look up the unqualified hostname using the system resolver's search rules. A value of B will cause L to fail instantly if B is enabled and the target hostname cannot be found in any of the domains specified by B. I< Optional. Type boolean. > =over 4 =item upstream_default value : yes =back =head2 CanonicalizeHostname Controls whether explicit hostname canonicalization is performed. The default, B, is not to perform any name rewriting and let the system resolver handle all hostname lookups. If set to B then, for connections that do not use a B or B, L will attempt to canonicalize the hostname specified on the command line using the B suffixes and B rules. If B is set to B, then canonicalization is applied to proxied connections too. If this option is enabled, then the configuration files are processed again using the new target name to pick up any new configuration in matching B and B stanzas. I< Optional. Type enum. choice: 'no', 'yes', 'always'. > =over 4 =item upstream_default value : no =back =head2 CanonicalizeMaxDots Specifies the maximum number of dot characters in a hostname before canonicalization is disabled. The default, 1, allows a single dot (i.e. hostname.subdomain). I< Optional. Type integer. > =over 4 =item upstream_default value : 1 =back =head2 CanonicalizePermittedCNAMEs Specifies rules to determine whether CNAMEs should be followed when canonicalizing hostnames. The rules consist of one or more arguments of I:I, where I is a pattern-list of domains that may follow CNAMEs in canonicalization, and I is a pattern-list of domains that they may resolve to. For example, "*.a.example.com:*.b.example.com,*.c.example.com" will allow hostnames matching "*.a.example.com" to be canonicalized to names in the "*.b.example.com" or "*.c.example.com" domains. I< Optional. Type uniline. > =head2 CASignatureAlgorithms Specifies which algorithms are allowed for signing of certificates by certificate authorities (CAs). The default is: ecdsa-sha2-nistp256.ecdsa-sha2-nistp384,ecdsa-sha2-nistp521, ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa L will not accept host certificates signed using algorithms other than those specified. I< Optional. Type uniline. > =head2 CertificateFile Specifies a file from which the user's certificate is read. A corresponding private key must be provided separately in order to use this certificate either from an B directive or B<-i> flag to L, via L, or via a B. Arguments to B may use the tilde syntax to refer to a user's home directory or the tokens described in the I section. It is possible to have multiple certificate files specified in configuration files; these certificates will be tried in sequence. Multiple B directives will add to the list of certificates used for authentication. I< Optional. Type uniline. > =head2 ChallengeResponseAuthentication Specifies whether to use challenge-response authentication. The argument to this keyword must be B (the default) or B. I< Optional. Type boolean. > =over 4 =item upstream_default value : yes =back =head2 CheckHostIP If set to B (the default), L will additionally check the host IP address in the I file. This allows it to detect if a host key changed due to DNS spoofing and will add addresses of destination hosts to I<~/.ssh/known_hosts> in the process, regardless of the setting of B. If the option is set to B, the check will not be executed. I< Optional. Type boolean. > =over 4 =item upstream_default value : yes =back =head2 Ciphers Specifies the ciphers allowed and their order of preference. Multiple ciphers must be comma-separated. If the specified value begins with a '+' character, then the specified ciphers will be appended to the default set instead of replacing them. If the specified value begins with a '-' character, then the specified ciphers (including wildcards) will be removed from the default set instead of replacing them. The supported ciphers are: 3des-cbc aes128-cbc aes192-cbc aes256-cbc aes128-ctr aes192-ctr aes256-ctr aes128-gcm@openssh.com aes256-gcm@openssh.com chacha20-poly1305@openssh.com The default is: chacha20-poly1305@openssh.com, aes128-ctr,aes192-ctr,aes256-ctr, aes128-gcm@openssh.com,aes256-gcm@openssh.com The list of available ciphers may also be obtained using "ssh -Q cipher". I< Optional. Type uniline. > =head2 ClearAllForwardings Specifies that all local, remote, and dynamic port forwardings specified in the configuration files or on the command line be cleared. This option is primarily useful when used from the L command line to clear port forwardings set in configuration files, and is automatically set by L and L. The argument must be B or B (the default). I< Optional. Type boolean. > =over 4 =item upstream_default value : no =back =head2 Compression Specifies whether to use compression. The argument must be B or B (the default). I< Optional. Type boolean. > =over 4 =item upstream_default value : no =back =head2 ConnectionAttempts Specifies the number of tries (one per second) to make before exiting. The argument must be an integer. This may be useful in scripts if the connection sometimes fails. The default is 1. I< Optional. Type integer. > =over 4 =item upstream_default value : 1 =back =head2 ConnectTimeout Specifies the timeout (in seconds) used when connecting to the SSH server, instead of using the default system TCP timeout. This value is used only when the target is down or really unreachable, not when it refuses the connection. I< Optional. Type integer. > =head2 ControlMaster Enables the sharing of multiple sessions over a single network connection. When set to B, L will listen for connections on a control socket specified using the B argument. Additional sessions can connect to this socket using the same B with B set to B (the default). These sessions will try to reuse the master instance's network connection rather than initiating new ones, but will fall back to connecting normally if the control socket does not exist, or is not listening. Setting this to B will cause L to listen for control connections, but require confirmation using L. If the B cannot be opened, L will continue without connecting to a master instance. X11 and L forwarding is supported over these multiplexed connections, however the display and agent forwarded will be the one belonging to the master connection i.e. it is not possible to forward multiple displays or agents. Two additional options allow for opportunistic multiplexing: try to use a master connection but fall back to creating a new one if one does not already exist. These options are: B and B. The latter requires confirmation like the B option. I< Optional. Type enum. choice: 'auto', 'autoask', 'yes', 'no', 'ask'. > =over 4 =item upstream_default value : no =back =head2 ControlPath Specify the path to the control socket used for connection sharing as described in the B section above or the string B to disable connection sharing. Arguments to B may use the tilde syntax to refer to a user's home directory or the tokens described in the I section. It is recommended that any B used for opportunistic connection sharing include at least %h, %p, and %r (or alternatively %C) and be placed in a directory that is not writable by other users. This ensures that shared connections are uniquely identified. I< Optional. Type uniline. > =head2 ControlPersist When used in conjunction with B, specifies that the master connection should remain open in the background (waiting for future client connections) after the initial client connection has been closed. If set to B, then the master connection will not be placed into the background, and will close as soon as the initial client connection is closed. If set to B or 0, then the master connection will remain in the background indefinitely (until killed or closed via a mechanism such as the "ssh -O exit"). If set to a time in seconds, or a time in any of the formats documented in L, then the backgrounded master connection will automatically terminate after it has remained idle (with no client connections) for the specified time. I< Optional. Type uniline. > =head2 DynamicForward Specifies that a TCP port on the local machine be forwarded over the secure channel, and the application protocol is then used to determine where to connect to from the remote machine. The argument must be [ I: ]I. IPv6 addresses can be specified by enclosing addresses in square brackets. By default, the local port is bound in accordance with the B setting. However, an explicit I may be used to bind the connection to a specific address. The I of B indicates that the listening port be bound for local use only, while an empty address or '*' indicates that the port should be available from all interfaces. Currently the SOCKS4 and SOCKS5 protocols are supported, and L will act as a SOCKS server. Multiple forwardings may be specified, and additional forwardings can be given on the command line. Only the superuser can forward privileged ports. I< Optional. Type list of uniline. > =head2 EnableSSHKeysign Setting this option to B in the global client configuration file I enables the use of the helper program L during B. The argument must be B or B (the default). This option should be placed in the non-hostspecific section. See L for more information. I< Optional. Type boolean. > =over 4 =item upstream_default value : no =back =head2 EscapeChar Sets the escape character (default: '~'). The escape character can also be set on the command line. The argument should be a single character, '^' followed by a letter, or B to disable the escape character entirely (making the connection transparent for binary data). I< Optional. Type uniline. > =head2 ExitOnForwardFailure Specifies whether L should terminate the connection if it cannot set up all requested dynamic, tunnel, local, and remote port forwardings, (e.g. if either end is unable to bind and listen on a specified port). Note that B does not apply to connections made over port forwardings and will not, for example, cause L to exit if TCP connections to the ultimate forwarding destination fail. The argument must be B or B (the default). I< Optional. Type boolean. > =over 4 =item upstream_default value : no =back =head2 FingerprintHash Specifies the hash algorithm used when displaying key fingerprints. Valid options are: B and B (the default). I< Optional. Type enum. choice: 'md5', 'sha256'. > =over 4 =item upstream_default value : sha256 =back =head2 ForwardAgent Specifies whether the connection to the authentication agent (if any) will be forwarded to the remote machine. The argument must be B or B (the default). Agent forwarding should be enabled with caution. Users with the ability to bypass file permissions on the remote host (for the agent's Unix-domain socket) can access the local agent through the forwarded connection. An attacker cannot obtain key material from the agent, however they can perform operations on the keys that enable them to authenticate using the identities loaded into the agent. I< Optional. Type boolean. > =over 4 =item upstream_default value : no =back =head2 ForwardX11 Specifies whether X11 connections will be automatically redirected over the secure channel and DISPLAY set. The argument must be B or B (the default). X11 forwarding should be enabled with caution. Users with the ability to bypass file permissions on the remote host (for the user's X11 authorization database) can access the local X11 display through the forwarded connection. An attacker may then be able to perform activities such as keystroke monitoring if the B option is also enabled. I< Optional. Type boolean. > =over 4 =item upstream_default value : no =back =head2 ForwardX11Timeout Specify a timeout for untrusted X11 forwarding using the format described in the I