ArcShell

arcshell_ssh.sh

Reference

ssh_copy_file

Copy a file or directory to all of the targeted nodes.

> ssh_copy_file [-local,-l] [-group,-g "X"|-tag,-t "X"|-ssh,-s "X"] "source_path" ["target_path"]
# -local: File can be copied local user node if it is one of the targets.
# -group: SSH group.
# -tag: SSH tag.
# -ssh: SSH alias or node.
# source_path: Path to local file or directory to copy.
# target_path: Path to destination directory.

ssh_run_cmd

Run a command on all of the targeted nodes.

> ssh_run_cmd [-local,-l] [-group,-g "X"|-tag,-t "X"|-ssh,-s "X"] "command"
# -local: Command can be run on local user node if it is one of the targets.
# -group: SSH group.
# -tag: SSH tag.
# -ssh: SSH alias or node.
# command: The command to run.

ssh_run_file

Run a file on all of the targeted nodes.

> ssh_run_file [-local,-l] [-group,-g "X"|-tag,-t "X"|-ssh,-s "X"] "source_path"
# -local: File can be run on local user node if it is one of the targets.
# -group: SSH group.
# -tag: SSH tag.
# -ssh: SSH alias or node.
# command: The command to run.

ssh_connect

Connect to a node using SSH.

> ssh_connect [-ssh "X"|"ssh_connection"|"regex"|?]
# -ssh: An SSH alias or node name.
# ssh_connection: An SSH alias or node name.
# regex: Runs the ssh connection menu and limited to matching values.
# ?: Same as above but matches on all values.

ssh_check

Validate the health of the current ssh connection.

> ssh_check [-ssh,-s "X"] [-fix,-f] ["ssh_connection"]
# -fix: Automatically fix the issues.
# ssh_connection: Same as '-ssh'.

ssh_send_key

Copy contents of ~/.ssh/id_rsa.pub to the current connection’s authorized keys file. Note: Function can be run multiple times, key is only added if it is not there.

> ssh_send_key [-ssh "X"] [-force] ["ssh_connection"]
# -force: Update authorized_keys entry even if it the key already exists.
# ssh_connection: Same as '-ssh'.

ssh_get_key

Get contents from remote ~/.ssh/id_rsa.pub and add it to local authorized_keys file.

> ssh_get_key [-force] [-ssh "X"] ["ssh_connection"]
# -force: Update authorized_keys entry even if it the key already exists.
# -ssh: SSH node name or alias.
# ssh_connection: SSH node name or alias.

ssh_swap_keys

Run both ssh_send_key and ssh_get_key.

> ssh_swap_keys [-ssh "X"] [-force] ["ssh_connection"]
# -ssh: SSH connection.
# -force: Update authorized_keys entries even if it the keys already exist.
# ssh_connection: Same as '-ssh'.

ssh_does_dir_exist

Return true if a remote directory exists.

> ssh_does_dir_exist [-ssh "X"] "directory"
# -ssh: SSH connection.
# directory: Full or relative path of directory you want to check for.

ssh_get_home

Return the home directory path for a node or group of nodes.

> ssh_get_home [-ssh "X"] ["ssh_connection"]
# -ssh: SSH connection.
# ssh_connection: Same as '-ssh'.

ssh_list_key_types_in_use

Return the list of ssh key types found in the provided directory.

> ssh_list_key_types_in_use