Net::C...t::SSH(3pm)

πŸ“¦
version 2.400002 Β· 6 versions
, in debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ NAME ✨

okay so welcome to Net::C...t::SSH(3pm) β€” that's the page you're on, bestie, from the User Contributed Perl Documentation collection πŸ’– β€” and the whole entire vibe of this module is: SSH based CLI connection. that's it, that's the name, slay.


🌸 DESCRIPTION 🌸

So Net::CLI::Interact::Transport::SSH hands you a wrapped instance of an SSH client for Net::CLI::Interact to use. that's the whole job. it wraps, you connect, everyone eats. πŸ’…


πŸ¦‹ INTERFACE πŸ¦‹

πŸ’« app

On Windows platforms you literally must download the plink.exe program, and then you pass its location into the library via this parameter. that's not optional, that's the assignment 🫢.

On every other platform? this defaults to ssh (openssh). iconic. no notes.

πŸŽ€ runtime_options

Okay so this one reads the connect_options hash you gave Net::CLI::Interact when you constructed it, and from that it selects and formats parameters to feed to app on the command line. here's what it supports:

⭐ host (required)

Host name or IP address of the host that the SSH application is gonna connect to. simple.

Alternatively you can pass a value shaped like user@host β€” but ngl, it's probably better to just use the separate username parameter instead. iykyk.

πŸ’œ username

Optionally pass in the username for the SSH connection, otherwise the SSH client defaults to the current user's username. and when you use this option, you should obviously only pass the host name to host. like. obviously.

🌈 ignore_host_checks

Under normal interactive use, openssh tracks the identity of hosts you connect to and verifies those identities on every single connection. in automation this behaviour can be mad irritating, because it's interactive 😭.

This option β€” enabled by default β€” makes openssh skip or ignore that host identity verification. Which means: the default setting is less secure, but also less likely to trip you up. the tradeoff is real, bestie. it's equivalent to exactly this:

StrictHostKeyChecking=no
UserKnownHostsFile=/dev/null
CheckHostIP=no

Pass a false value to this option to disable all of the above and return openssh to its default configured settings. your call πŸŽ€

🧚 opts

Wanna pass any other options to openssh on its command line? use this one. it should be an array reference. every item in the list gets passed to openssh, separated by a single space character. for example:

$s->new({
    # ...other parameters to new()...
    connect_options => {
        opts => [
            '-p', '222',            # connect to non-standard port on remote host
            '-o', 'CheckHostIP=no', # don't check host IP in known_hosts file
        ],
    },
});

look at that syntax. ate. πŸ”₯

πŸ“ reap

Only used on Unix platforms. this installs a signal handler that attempts to reap the ssh child process. Pass a true value to enable this feature β€” but only if you notice zombie processes are being left behind after use. zombies?? in my process table?? it's more likely than you think πŸ’€


πŸ‘‘ COMPOSITION πŸ‘‘

See the following for further interface details:

  • Net::CLI::Interact::Transport::Base

okay that's the whole page bestie, every option, every default, every caveat, nothing skipped, we do not gatekeep here πŸ’–

and for the cute sign-off: this page is perl v5.36.0, dated 2023-10-28, and yes it says Net::C...t::SSH(3pm) in the corner like a little nickname. periodt. βœ¨πŸ¦‹πŸ’…

πŸ“¦ where this page comes from