models/Ssh.pl

filter: Statementstmt 100% 13 / 13 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod n/a totaltotal 100% 17 / 17 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Backend/OpenSsh/Sshd.pm ↑ Summary models/Ssh/HostElement.pl »
1 #
2 # This file is part of Config-Model-OpenSsh
3 #
4 # This software is Copyright (c) 2008-2025 by Dominique Dumont.
5 #
6 # This is free software, licensed under:
7 #
8 # The GNU Lesser General Public License, Version 2.1, February 1999
9 #
10 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
11 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 return [
14 {
15 1 'accept' => [
16 '.*',
17 {
18 'summary' => 'boilerplate parameter that may hide a typo',
19 'type' => 'leaf',
20 'value_type' => 'uniline',
21 'warn' => 'Unknown parameter. Please make sure there\'s no typo and contact the author'
22 }
23 ],
24 'class_description' => 'This configuration class was generated from ssh_system documentation.
25 by L<parse-man.pl|https://github.com/dod38fr/config-model-openssh/contrib/parse-man.pl>
26 ',
27 'element' => [
28 'Host',
29 {
30 'cargo' => {
31 'config_class_name' => 'Ssh::HostElement',
32 'type' => 'node'
33 },
34 'description' => 'Restricts the following declarations (up to the next B<Host> or B<Match>
35 keyword) to be only for those hosts that match one of the patterns given after
36 the keyword. If more than one pattern is provided, they should be separated by
37 whitespace. A single \'*\' as a pattern can be used to provide global defaults
38 for all hosts. The host is usually the I<hostname> argument given on the
39 command line (see the B<CanonicalizeHostname> keyword for exceptions).
40  
41 A pattern entry may be negated by prefixing it with an exclamation mark (\'!\' )
42 If a negated entry is matched, then the B<Host> entry is ignored, regardless of
43 whether any other patterns on the line match. Negated matches are therefore
44 useful to provide exceptions for wildcard matches.
45  
46 See I<PATTERNS> for more information on patterns.',
47 'index_type' => 'string',
48 'ordered' => '1',
49 'type' => 'hash'
50 },
51 'Match',
52 {
53 'cargo' => {
54 'config_class_name' => 'Ssh::HostElement',
55 'type' => 'node'
56 },
57 'description' => 'Restricts the following declarations (up to the next B<Host> or B<Match>
58 keyword) to be used only when the conditions following the B<Match> keyword are
59 satisfied. Match conditions are specified using one or more criteria or the
60 single token B<all> which always matches. The available criteria keywords are:
61 B<canonical> B<final> B<exec> B<localnetwork> B<host> B<originalhost> B<tagged>
62 B<command> B<user> B<localuser> and B<version> The B<all> criteria must appear
63 alone or immediately after B<canonical> or B<final> Other criteria may be
64 combined arbitrarily. All criteria but B<all> B<canonical> and B<final> require
65 an argument. Criteria may be negated by prepending an exclamation mark (\'!\' )
66  
67 The B<canonical> keyword matches only when the configuration file is being
68 re-parsed after hostname canonicalization (see the B<CanonicalizeHostname>
69 option). This may be useful to specify conditions that work with canonical host
70 names only.
71  
72 The B<final> keyword requests that the configuration be re-parsed (regardless
73 of whether B<CanonicalizeHostname> is enabled), and matches only during this
74 final pass. If B<CanonicalizeHostname> is enabled, then B<canonical> and
75 B<final> match during the same pass.
76  
77 The B<exec> keyword executes the specified command under the user\'s shell. If
78 the command returns a zero exit status then the condition is considered true.
79 Commands containing whitespace characters must be quoted. Arguments to B<exec>
80 accept the tokens described in the I<TOKENS> section.
81  
82 The B<localnetwork> keyword matches the addresses of active local network
83 interfaces against the supplied list of networks in CIDR format. This may be
84 convenient for varying the effective configuration on devices that roam between
85 networks. Note that network address is not a trustworthy criteria in many
86 situations (e.g. when the network is automatically configured using DHCP) and
87 so caution should be applied if using it to control security-sensitive
88 configuration.
89  
90 The other keywords\' criteria must be single entries or comma-separated lists
91 and may use the wildcard and negation operators described in the I<PATTERNS>
92 section.
93  
94 The criteria for the B<host> keyword are matched against the target hostname,
95 after any substitution by the B<Hostname> or B<CanonicalizeHostname> options.
96 The B<originalhost> keyword matches against the hostname as it was specified on
97 the command-line.
98  
99 The B<tagged> keyword matches a tag name specified by a prior B<Tag> directive
100 or on the L<ssh(1)> command-line using the -B<P> flag. The B<command> keyword
101 matches the remote command that has been requested, or the subsystem name that
102 is being invoked (e.g. Qq sftp for an SFTP session). The empty string will
103 match the case where a command or tag has not been specified, i.e. \'Match tag \'
104 The B<version> keyword matches against the version string of L<ssh(1)>, for
105 example \'\'OpenSSH_10.0\'\'
106  
107 The B<user> keyword matches against the target username on the remote host. The
108 B<localuser> keyword matches against the name of the local user running
109 L<ssh(1)> (this keyword may be useful in system-wide B<ssh_config> files).
110  
111 Finally, the B<sessiontype> keyword matches the requested session type, which
112 may be one of B<shell> for interactive sessions, B<exec> for command execution
113 sessions, B<subsystem> for subsystem invocations such as L<sftp(1)>, or B<none>
114 for transport-only sessions, such as when L<ssh(1)> is started with the -B<N>
115 flag.',
116 'index_type' => 'string',
117 'ordered' => '1',
118 'type' => 'hash'
119 }
120 ],
121 'generated_by' => 'parse-man.pl from ssh_system 10.2p1 doc',
122 'include' => [
123 'Ssh::HostElement'
124 ],
125 'include_after' => 'Host',
126 'license' => 'LGPL2',
127 'name' => 'Ssh',
128 'rw_config' => {
129 'auto_create' => '1',
130 'backend' => 'OpenSsh::Ssh',
131 'config_dir' => '~/.ssh',
132 'file' => 'config'
133 }
134 }
135 ]
136 ;
137  
« Backend/OpenSsh/Sshd.pm ↑ Summary models/Ssh/HostElement.pl »