clogin

automated login to Cisco network devices

TLDR

Login to a Cisco device
$ clogin [hostname]
Login with specific username
$ clogin -u [username] [hostname]
Login and run commands from file
$ clogin -x [commands.txt] [hostname]
Login with autoenable
$ clogin -autoenable [hostname]
Login to multiple devices
$ clogin [host1] [host2] [host3]
Login with specific password file
$ clogin -f [/path/to/.cloginrc] [hostname]

SYNOPSIS

clogin [options] hostname [hostname...]

DESCRIPTION

clogin is part of RANCID (Really Awesome New Cisco confIg Differ), a network device configuration management system. It provides automated login to Cisco and compatible network devices, handling authentication and enable mode transitions.The tool uses Expect scripts to automate the interactive login process, supporting various authentication methods and device prompts. It can execute commands or scripts across multiple devices, making it valuable for network automation and configuration backup.Credentials are typically stored in .cloginrc with restricted permissions. The tool supports SSH, telnet, and other access methods depending on device configuration.

PARAMETERS

-u username

Specify username for login.
-p password
Specify password (insecure, use .cloginrc instead).
-e enablepassword_
Specify enable password.
-autoenable
Automatically enter enable mode.
-c command
Execute command after login.
-x cmdfile
Execute commands from file.
-f rcfile
Use alternate configuration file.
-t timeout
Set login timeout in seconds.
-d
Enable debug output.
-v
Enable verbose output.

CONFIGURATION

~/.cloginrc

Stores device credentials, authentication methods, and connection settings. Must be chmod 600.

INSTALL

sudo apt install rancid
sudo dnf install rancid
sudo apk add rancid
brew install rancid
nix profile install nixpkgs#rancid

CAVEATS

Requires Expect and Tcl. The .cloginrc file contains sensitive credentials; protect with chmod 600. Some device prompts may not be recognized without customization. Modern alternatives like Ansible or Netmiko may be preferred for new automation projects.

HISTORY

clogin was developed as part of RANCID (Really Awesome New Cisco confIg Differ) by Henry Kilmer and others at Shrubbery Networks in the late 1990s. RANCID was created to automate configuration backup and change tracking for network devices. The toolkit has grown to support numerous vendors beyond Cisco, with clogin handling Cisco-specific devices.

SEE ALSO

expect(1)