Simplify your set of predefined SSH connections for iTerm2 on MacOS like session manager.
Use only one YAML file to define all your "inventory" and
get your set of iTerm2 Profiles.
Supported system transport:
- SSH2
- SSH1 (to do)
- Telnet (to do)
defaults:
user: bob
port: 22
transport: ssh2
open_pass_manager: true
extra_args:
groups:
offices:
user: ubuntu
keepalive_interval: 240
terminal_type: xterm
dc1: {}
core:
port: 9922
log_output: true
log_directory: "/Users/HugeUser/itermlogs/"
log_plain_text: true
hosts:
border1:
ip: 10.14.2.1
user:
groups: [core]
log_output: false
spine2:
ip: 10.14.15.1
groups: [core, dc1]
another-hostname:
ip: 10.14.15.2
custom-server:
ip: 10.14.100.1
port: 7722
open_pass_manager: false
extra_args: -oCiphers=3des-cbc -s netconf
groups: [offices]defaultssection defines base low priority rule for each sessiongroupssection defines medium priority rules for child sessionshostssection defines host name/address and high priority rules
All generated profiles inherit Default iTerm2 Profile settings. Rerun script after changing Default profile.
New in v0.2:
You can create many inventory files with profiles in ~/Documents/ with .iprofiles extension!
ip- address or fqdn to connectuser- username for the session (ssh username@1.1.1.1)porttransport- protocol to use (onlyssh2supported at the moment)open_pass_manager- settrueto automatically open iTerm2 password manager after connectextra_args- append some extra options to execute in shell
New in v0.2:
keepalive_interval- When idle, send LF (\n) every X seconds (USE WITH ATTENTION!)
New in v0.3:
terminal_type- Report Terminal type (Emulation) choose from [vt100, xterm, xterm-new, xterm-256color, ansi, rxvt, linux]
New in v0.4:
log_output- overrides Default session output logging behaviour.trueto log into file,falseto disablelog_directory- log file location (no logging if location are not valid. can be checked after in iterm profile settings)log_plain_text- control sequences will be stripped out before logging +timestamp (true/false)
- iTerm2 > Scripts > Manage > Install Python Runtime
~/Library/Application\ Support/iTerm2/iterm2env/versions/*LASTEST_VERSION*/bin/python3 -m pip install pyyamlcd ~/Library/Application\ Support/iTerm2/Scriptsgit clone https://github.com/lastorel/iterm2-ssh-helper.git(or your preferred method)- create and compose your YAML inventory file at
~/Documents/devices.yamlor~/Documents/workspace-example.iprofiles - iTerm2 > Scripts > execute new
manager_sync.py - wait a few seconds
Use
cmd+shift+Bto open Profiles panel