| cloginrc(5) | File Formats Manual | cloginrc(5) |
.cloginrc - clogin configuration file
.cloginrc contains configuration information for alogin(1), blogin(1), clogin(1), csblogin(1), elogin(1), flogin(1), fnlogin(1), hlogin(1), htlogin(1), jlogin(1), nlogin(1), nslogin(1), rivlogin(1), and wlogin(1), such as usernames, passwords, ssh encryption type, etc., and is read at run-time.
Each line contains either white-space (blank line), a comment which begins with the comment character '#' and may be preceded by white-space, or one of the directives listed below.
Each line containing a directive is of the form:
add <directive> <hostname glob> {<value>} [{<value>} ...]
or
include {<file>}
Note: the braces ({}) surrounding the values is significant when the values include TCL meta-characters. Best common practice is to always enclose the values in braces. If a value includes a (left or right) brace, space character, ampersand or blackslash, those characters must be backslash-escaped, as in:
add user <hostname glob> {foo\}bar}
add user <hostname glob> {foo\ bar}
Other special characters may be escaped without error, if desired.
As .cloginrc is searched for a directive matching a hostname, it is always the first matching instance of a directive, one whose hostname glob expression matches the hostname, which is used. For example; looking up the "password" directive for hostname foo in a .cloginrc file containing
add password * {bar} {table}
add password foo {bar} {table}
would return the first line, even though the second is an exact match.
.cloginrc is expected to exist in the user's home directory and must not be readable, writable, or executable by "others". .cloginrc should be mode 0600, or 0640 if it is to be shared with other users who are members of the same unix group. See chgrp(1) and chmod(1) for more information on ownership and file modes.
The accepted directives are (alphabetically):
Example: add autoenable * {1}
Default: 0
zero, meaning that the user is not automatically enabled and clogin should execute the enable command to gain enable privileges, unless negated by the noenable directive or -noenable command-line option.
Also see the noenable directive.
Default: empty
Example: add enableprompt rc*.example.net {"\[Ee]nter\ the\ enable\ password:"}
Default: "\[Pp]assword:"
Default: your default identity file. see ssh(1).
Note: Different versions of telnet treat the specification of a port differently. In particular, BSD derived telnets do not do option negotiation when a port is given. Some devices, Extreme switches for example, have undesirable telnet default options such as linemode. In the BSD case, to enable option negotiation when specifying a port the method should be "{telnet:-23}" or, better, add "mode character" to .telnetrc. See telnet(1) for more information on telnet command-line syntax, telnet options, and .telnetrc.
Example: add method * {ssh} {telnet:3000} {rsh}
Which would cause clogin to first attempt an ssh connection to the device and if that were to fail with connection refused, a telnet connection to port 3000 would be tried, and then a rsh connection.
Note that not all platforms support all of these connection methods.
Default: {telnet} {ssh}
Note that this directive is meaningless for jlogin(1), nlogin(1) and clogin(1) [for Extreme] which do not have the concept of "enabled" and/or no way to elevate privleges once logged in; a user either has the necessary privleges or doesn't.
Example: add passphrase rc*.example.net {the\ bird\ goes\ tweet}
Example: add passprompt rc*.example.net {"\[Ee]nter\ the\ password:"}
Default: "(\[Pp]assword|passwd):"
Note that not all login scripts support this.
sshcmd also allows the user to add any other command-line options, such as altering the offered key exchange algorithms. For example: add sshcmd * {ssh\ -o\ KexAlgorithms=+diffie-hellman-group1-sha1}
Default: ssh
Default: device dependent
telnetcmd also allows the user to add any other command-line options, such as force IPv4. For example: add telnetcmd * {telnet\ -K4}
Default: telnet -K
Default: $USER (or $LOGNAME), i.e.: your Unix username.
Example: add userprompt rc*.example.net {"\[Ee]nter\ your\ username:"}
Default: "(Username|login|user name):"
If <file> is not a full pathname, $HOME/ will be prepended.
Example: include {.cloginrc.group}
$HOME/.cloginrc Configuration file described here. share/rancid/cloginrc.sample A sample .cloginrc.
.cloginrc is interpreted directly by Tcl, so its syntax follows that of Tcl. Errors may produce quite unexpected results.
| 12 April 2017 |