SSH Functions
Usage
sshKnownHostAdd [ hostName ... ]
Adds the host to the ~/.known_hosts if it is not found in it already
Side effects:
1. ~/.ssh may be created if it does not exist
1. ~/.ssh mode is set to 0700 (read/write/execute user)
1. ~/.ssh/known_hosts is created if it does not exist
1. ~/.ssh/known_hosts mode is set to 0600 (read/write user)
1. ~./.ssh/known_hosts is possibly modified (appended)
If this function fails then ~/.ssh/known_hosts may be modified for any hosts which did not fail
If no arguments are passed, the default behavior is to set up the ~/.ssh directory and create the known hosts file.
Arguments
hostName ...- String. Optional. One ore more hosts to add to the known hosts file
Return codes
1- Environment errors0- All hosts exist in or were successfully added to the known hosts file
Usage
sshSetup [ --force ] server
Set up SSH for a user with ID and backup keys in ~/.ssh
Create a key for a user for SSH authentication to other servers.
Add .ssh key for current user
You will need the password for this server for the current user.
Arguments
--force- Flag. Optional. Force the program to create a new key if one existsserver- String. Required. Servers to connect to to set up authorization
Return codes
0- Success1- Environment error2- Argument error
Requires
userRecordHome catchEnvironment throwEnvironment
Usage
sshKnownHostRemove [ hostName ... ] [ --skip-backup | --no-backup ] [ --verbose ]
Adds the host to the ~/.known_hosts if it is not found in it already
Side effects:
1. ~/.ssh may be created if it does not exist
1. ~/.ssh mode is set to 0700 (read/write/execute user)
1. ~/.ssh/known_hosts is created if it does not exist
1. ~/.ssh/known_hosts mode is set to 0600 (read/write user)
1. ~./.ssh/known_hosts is possibly modified (appended)
If this function fails then ~/.ssh/known_hosts may be modified for any hosts which did not fail
If no arguments are passed, the default behavior is to set up the ~/.ssh directory and create the known hosts file.
Arguments
hostName ...- String. Optional. One ore more hosts to add to the known hosts file --skip-backup |---no-backup- Flag. Optional. Skip the file backup asname.$(dateToday)--verbose- Flag. Optional. Be verbose.
Return codes
1- Environment errors0- All hosts exist in or were successfully added to the known hosts file
Usage
sshKnownHostsFile
No documentation for sshKnownHostsFile.
Arguments
- none
Return codes
0- Success1- Environment error2- Argument error